• R/O
  • SSH
  • HTTPS

shaman: Commit


Commit MetaInfo

Révision71 (tree)
l'heure2012-11-25 21:39:57
Auteurshom5xg

Message de Log

implement the debug-dip control menu

Change Summary

Modification

--- trunk/program/src/game.cpp (revision 70)
+++ trunk/program/src/game.cpp (revision 71)
@@ -28,6 +28,10 @@
2828
2929 #include "core/debug/fps_counter/fps_counter.h"
3030
31+#include "core/input/input_keyboard.h"
32+#include "core/input/input_keyboard_def.h"
33+
34+
3135 /***************************************************************************
3236 game( namespace )
3337 ****************************************************************************/
@@ -84,14 +88,19 @@
8488 {
8589 g_p_service_input->Update();
8690
87- g_p_service_stage->Update();
88- g_p_service_entity->UpdatePreCollisionDetect();
89- g_p_service_collision->Update();
90- g_p_service_entity->UpdatePostCollisionDetect();
91- g_p_service_frontend->Update();
92- g_p_service_entity->UpdatePreDraw();
91+#ifdef _DEBUG
92+ if( !IsDip( eDebugDipItem_PAUSE_ALL_UPDATE ) )
93+#endif
94+ {
95+ g_p_service_stage->Update();
96+ g_p_service_entity->UpdatePreCollisionDetect();
97+ g_p_service_collision->Update();
98+ g_p_service_entity->UpdatePostCollisionDetect();
99+ g_p_service_frontend->Update();
100+ g_p_service_entity->UpdatePreDraw();
93101
94- g_p_mode_manager->Update();
102+ g_p_mode_manager->Update();
103+ }
95104
96105 return ( g_p_mode_manager->IsEnd() );
97106 }
@@ -112,7 +121,7 @@
112121 }
113122
114123 #ifdef _DEBUG
115- if( IsDip( eDEBUG_DIP_DRAW_FPS ) )
124+ if( IsDip( eDebugDipItem_DRAW_FPS ) )
116125 {
117126 cu32 uFps ( fps_counter::fps_counter_get() );
118127
@@ -124,6 +133,62 @@
124133 context.uPosY = 10;
125134 g_p_font_gdi->Draw( sz_temp, context );
126135 }
136+
137+ {
138+ static b32 s_bMenuActive ( FALSE );
139+ static eDebugDipItem s_eCursor ( eDebugDipItem_Default );
140+
141+ const cinput_keyboard* const p_keyboard = g_p_service_input->GetKeyboard();
142+
143+ ///--
144+ if( p_keyboard->IsPush( input_keyboard_def::KEY_M ) )
145+ {
146+ s_bMenuActive = !s_bMenuActive;
147+ }
148+ ///--
149+
150+ if( s_bMenuActive )
151+ {
152+ ///--
153+ if( p_keyboard->IsPush( input_keyboard_def::KEY_DIR_LEFT ) )
154+ {
155+ SetDip( s_eCursor, TRUE );
156+ }
157+ else if( p_keyboard->IsPush( input_keyboard_def::KEY_DIR_RIGHT ) )
158+ {
159+ SetDip( s_eCursor, FALSE );
160+ }
161+ ///--
162+
163+ ///--
164+ if( p_keyboard->IsPush( input_keyboard_def::KEY_DIR_DOWN ) )
165+ {
166+ if( s_eCursor < eNof_DebugDipItem )
167+ {
168+ s_eCursor = SCAST< eDebugDipItem >( s_eCursor + 1 );
169+ }
170+ }
171+ else if( p_keyboard->IsPush( input_keyboard_def::KEY_DIR_UP ) )
172+ {
173+ if( s_eCursor > eDebugDipItem_Zero )
174+ {
175+ s_eCursor = SCAST< eDebugDipItem >( s_eCursor - 1 );
176+ }
177+ }
178+ ///--
179+
180+ for( u16 i=0; i<eNof_DebugDipItem; ++i )
181+ {
182+ TCHAR sz_temp[256] = {0};
183+ const eDebugDipItem eItem ( static_cast< eDebugDipItem >( i ) );
184+ wsprintf( sz_temp, _T( "%s %s %s" ), ( ( s_eCursor == i ) ? _T( "*" ) : _T( " " ) ), GetDipItemName( eItem ), ( IsDip( eItem ) ? _T( "ON" ) : _T( "OFF" ) ) );
185+ font_def::FontContext_t context;
186+ context.uPosX = 10;
187+ context.uPosY = 50 + 20 * i;
188+ g_p_font_gdi->Draw( sz_temp, context );
189+ }
190+ }
191+ }
127192 #endif
128193 }
129194
Afficher sur ancien navigateur de dépôt.