Révision | e3998d07e6586e4dbc492117d44a41b2411e9a7f (tree) |
---|---|
l'heure | 2012-11-18 23:54:38 |
Auteur | shom5xg <shom@.(no...> |
Commiter | shom5xg |
remove parameter calling as global variables
@@ -94,11 +94,11 @@ cboard::~cboard() | ||
94 | 94 | release_all(); |
95 | 95 | } |
96 | 96 | |
97 | -b32 cboard::Initialize( crender* in_p_render ) | |
97 | +b32 cboard::Initialize() | |
98 | 98 | { |
99 | 99 | #ifdef DX |
100 | 100 | ///-- |
101 | - LPDIRECT3DDEVICE9 p_device = in_p_render->GetDevice(); | |
101 | + LPDIRECT3DDEVICE9 p_device = g_p_render->GetDevice(); | |
102 | 102 | |
103 | 103 | const HRESULT hr = |
104 | 104 | p_device->CreateVertexBuffer( |
@@ -215,19 +215,19 @@ void cboard::update_vertex() | ||
215 | 215 | { |
216 | 216 | static f32 convert_pos_x( f32 pos_x ) |
217 | 217 | { |
218 | - const u32 client_width = window::GetClientWidth(); | |
218 | + const u32 sc_uClientWidth = window::GetClientWidth(); | |
219 | 219 | |
220 | 220 | const f32 pos_x_on_ratio_of_screen = |
221 | - pos_x / SCAST<f32>( client_width ); | |
221 | + pos_x / SCAST<f32>( sc_uClientWidth ); | |
222 | 222 | return ( pos_x_on_ratio_of_screen * 2.0f - 1.0f ); |
223 | 223 | } |
224 | 224 | |
225 | 225 | static f32 convert_pos_y( f32 pos_y ) |
226 | 226 | { |
227 | - const u32 client_height = window::GetClientHeight(); | |
227 | + const u32 sc_uClientHeight = window::GetClientHeight(); | |
228 | 228 | |
229 | 229 | const f32 pos_y_on_ratio_of_screen = |
230 | - 1.0f - pos_y / SCAST<f32>( client_height ); | |
230 | + 1.0f - pos_y / SCAST<f32>( sc_uClientHeight ); | |
231 | 231 | return ( pos_y_on_ratio_of_screen * 2.0f - 1.0f ); |
232 | 232 | } |
233 | 233 | }; |
@@ -273,10 +273,10 @@ void cboard::update_vertex() | ||
273 | 273 | #endif |
274 | 274 | } |
275 | 275 | |
276 | -void cboard::Draw( crender* in_p_render ) | |
276 | +void cboard::Draw() | |
277 | 277 | { |
278 | 278 | #ifdef DX |
279 | - LPDIRECT3DDEVICE9 p_device = in_p_render->GetDevice(); | |
279 | + LPDIRECT3DDEVICE9 p_device = g_p_render->GetDevice(); | |
280 | 280 | |
281 | 281 | p_device->SetStreamSource( 0, m_p_buf_vertex, 0, sizeof( board_vertex_t ) ); |
282 | 282 | p_device->SetFVF( MY_FVF_BOARD ); |
@@ -21,7 +21,7 @@ public: | ||
21 | 21 | cboard(); |
22 | 22 | virtual ~cboard(); |
23 | 23 | |
24 | - virtual b32 Initialize( crender* in_p_render ); | |
24 | + virtual b32 Initialize(); | |
25 | 25 | virtual void Finalize(); |
26 | 26 | |
27 | 27 | virtual void Update( b32 b_force = FALSE ); |
@@ -29,7 +29,7 @@ private: //-- inner function | ||
29 | 29 | void update_fade(); |
30 | 30 | void update_vertex(); |
31 | 31 | public: //-- |
32 | - virtual void Draw( crender* in_p_render ); | |
32 | + virtual void Draw(); | |
33 | 33 | |
34 | 34 | virtual void SetPos( const vec3f& in_v3_pos ); |
35 | 35 | virtual void SetPos( const vec2f& in_v2_pos ); |
@@ -56,22 +56,21 @@ void cimage_board::release_all() | ||
56 | 56 | #endif |
57 | 57 | } |
58 | 58 | |
59 | -b32 cimage_board::Initialize( crender* in_p_render ) | |
59 | +b32 cimage_board::Initialize() | |
60 | 60 | { |
61 | - return ( cboard::Initialize( in_p_render ) ); | |
61 | + return ( cboard::Initialize() ); | |
62 | 62 | } |
63 | 63 | |
64 | 64 | b32 cimage_board::Initialize( |
65 | - crender* in_p_render, | |
66 | 65 | const TCHAR* const sz_path_texture, |
67 | 66 | f32 width, f32 height |
68 | 67 | ) |
69 | 68 | { |
70 | - const b32 b_success = Initialize( in_p_render ); | |
69 | + const b32 b_success = Initialize(); | |
71 | 70 | |
72 | 71 | if( b_success ) |
73 | 72 | { |
74 | - const u32 idx = CreateTexture( in_p_render, sz_path_texture, width, height ); | |
73 | + const u32 idx = CreateTexture( sz_path_texture, width, height ); | |
75 | 74 | SetTextureActive( idx ); |
76 | 75 | } |
77 | 76 |
@@ -83,14 +82,14 @@ void cimage_board::Finalize() | ||
83 | 82 | cboard::Finalize(); |
84 | 83 | } |
85 | 84 | |
86 | -void cimage_board::Draw( crender* in_p_render ) | |
85 | +void cimage_board::Draw() | |
87 | 86 | { |
88 | 87 | #ifdef DX |
89 | 88 | ///-- |
90 | 89 | if( m_idx_texture_active != U32_INVALID ) |
91 | 90 | { |
92 | 91 | ///-- reset info and setting |
93 | - LPDIRECT3DDEVICE9 p_device = in_p_render->GetDevice(); | |
92 | + LPDIRECT3DDEVICE9 p_device = g_p_render->GetDevice(); | |
94 | 93 | |
95 | 94 | //-- |
96 | 95 | ASSERT( m_p_texture_list[ m_idx_texture_active ] ); |
@@ -123,7 +122,7 @@ void cimage_board::Draw( crender* in_p_render ) | ||
123 | 122 | ///-- |
124 | 123 | |
125 | 124 | ///-- draw |
126 | - cboard::Draw( in_p_render ); | |
125 | + cboard::Draw(); | |
127 | 126 | ///-- |
128 | 127 | #else |
129 | 128 | glBindTexture( GL_TEXTURE_2D, m_idx_texture_active ); |
@@ -162,7 +161,6 @@ void cimage_board::Draw( crender* in_p_render ) | ||
162 | 161 | } |
163 | 162 | |
164 | 163 | u32 cimage_board::CreateTexture( |
165 | - crender* in_p_render, | |
166 | 164 | const TCHAR* const sz_path_texture, |
167 | 165 | f32 width, f32 height |
168 | 166 | ) |
@@ -178,7 +176,7 @@ u32 cimage_board::CreateTexture( | ||
178 | 176 | ///-- |
179 | 177 | LPDIRECT3DTEXTURE9 p_texture_create; |
180 | 178 | D3DXCreateTextureFromFileEx( |
181 | - in_p_render->GetDevice(), | |
179 | + g_p_render->GetDevice(), | |
182 | 180 | sz_path_texture, |
183 | 181 | #if 1 |
184 | 182 | D3DX_DEFAULT/*get from texture*/, //Width |
@@ -28,18 +28,16 @@ private: //-- inner function | ||
28 | 28 | void release_all(); |
29 | 29 | public: //-- |
30 | 30 | |
31 | - virtual b32 Initialize( crender* in_p_render ); | |
31 | + virtual b32 Initialize(); | |
32 | 32 | virtual b32 Initialize( |
33 | - crender* in_p_render, | |
34 | 33 | const TCHAR* const sz_path_texture, |
35 | 34 | f32 width = F32_INVALID, f32 height = F32_INVALID |
36 | 35 | ); |
37 | 36 | virtual void Finalize(); |
38 | 37 | |
39 | - virtual void Draw( crender* in_p_render ); | |
38 | + virtual void Draw(); | |
40 | 39 | |
41 | 40 | u32 CreateTexture( |
42 | - crender* in_p_render, | |
43 | 41 | const TCHAR* const sz_path_texture, |
44 | 42 | f32 width = F32_INVALID, f32 height = F32_INVALID |
45 | 43 | ); |