• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

Commit MetaInfo

Révision3dbf5a3c272eeca60274b6d276a8a4ae2b2b8d2d (tree)
l'heure2012-11-18 23:47:15
Auteurshom5xg <shom@.(no...>
Commitershom5xg

Message de Log

activate debug-dip

Change Summary

Modification

--- a/core/src/core/app.h
+++ b/core/src/core/app.h
@@ -4,9 +4,12 @@
44 @author shom
55 ****************************************************************************/
66
7+#pragma once
8+
79 namespace app
810 {
911 enum{ g_kFps = 60 };
12+ enum{ g_kSec = 1000 };
1013
1114 typedef void (*fnGameInit)( HWND h_wnd, HINSTANCE h_inst );
1215 typedef void (*fnGameFin)();
--- a/core/src/core/app_dx.cpp
+++ b/core/src/core/app_dx.cpp
@@ -47,6 +47,10 @@ namespace
4747
4848 void app::AppInit( HINSTANCE in_h_inst, fnGameInit in_fnGameInit, int nCmdShow )
4949 {
50+#ifdef _DEBUG
51+ debug_dip::InitDip();
52+#endif
53+
5054 h_wnd = window::InitApp( in_h_inst, nCmdShow );
5155 h_inst = in_h_inst;
5256
@@ -94,8 +98,16 @@ int app::AppFin( fnGameFin in_fnGameFin )
9498 ///--
9599
96100 ///--
97- return ( window::FinApp( h_wnd, h_inst ) );
101+ const b32 bRet ( window::FinApp( h_wnd, h_inst ) );
102+ ///--
103+
104+ ///--
105+#ifdef _DEBUG
106+ debug_dip::FinDip();
107+#endif
98108 ///--
109+
110+ return bRet;
99111 }
100112
101113 void app::AppLoop( fnGameLoopExec in_fnExec, fnGameLoopDraw in_fnDraw )
@@ -129,9 +141,9 @@ void app_private::game_loop_fin()
129141 const u32 tm_exec_end = get_time();
130142 const u32 tm_exec_elapsed = tm_exec_end - tm_start;
131143
132- if( 1000 / app::g_kFps > tm_exec_elapsed )
144+ if( app::g_kSec / app::g_kFps > tm_exec_elapsed )
133145 {
134- proc_msg_and_wait( 1000 / app::g_kFps - tm_exec_elapsed - 1/*小数点切り下げ還元*/ );
146+ proc_msg_and_wait( app::g_kSec / app::g_kFps - tm_exec_elapsed - 1/*小数点切り下げ還元*/ );
135147 }
136148 else
137149 {
@@ -195,8 +207,11 @@ void app_private::proc_msg_and_wait( const u32 tm_wait )
195207 void app_private::game_loop_exec( app::fnGameLoopExec in_fnExec )
196208 {
197209 using namespace window;
210+ using namespace debug_dip;
198211
199- if( IsWindowActive() && !IsMessageBoxAppearing() )
212+ if( ( IsDip( eDEBUG_DIP_PROC_ONLY_FOCUSING ) ? IsWindowActive() : TRUE ) &&
213+ !IsMessageBoxAppearing()
214+ )
200215 {
201216 if( (in_fnExec)() )
202217 {
@@ -215,10 +230,6 @@ void app_private::game_loop_draw( app::fnGameLoopDraw in_fnDraw )
215230 {
216231 (in_fnDraw)();
217232
218-#ifdef _DEBUG
219- fps_counter::fps_counter_draw();
220-#endif
221-
222233 VERIFY( g_p_render->EndDraw() );
223234 }
224235 else
--- a/core/src/core/debug/debug_dip/debug_dip.cpp
+++ b/core/src/core/debug/debug_dip/debug_dip.cpp
@@ -72,7 +72,7 @@ void debug_dip::InitDip()
7272 #define DEBUG_DIP_ITEM( _category, _name, _msg ) \
7373 \
7474 { \
75- const u32 ret = \
75+ cu32 ret = \
7676 GetPrivateProfileInt( _T( #_category ), _T( #_name ), 0, sz_path ); \
7777 \
7878 SetDip( eDEBUG_DIP_##_name##, ( ret != 0 ) ); \
@@ -95,10 +95,10 @@ void debug_dip::FinDip()
9595 \
9696 { \
9797 TCHAR sz_unit[256] = {0}; \
98- const b32 b_on = IsDip( eDEBUG_DIP_##_name## ); \
98+ cb32 b_on ( IsDip( eDEBUG_DIP_##_name## ) ); \
9999 wsprintf( \
100100 sz_unit, \
101- _T( "%s = %d\n" ), \
101+ _T( "%s=%d\r\n" ), \
102102 _T( #_name ), \
103103 static_cast<UINT>( b_on ) \
104104 ); \
@@ -114,11 +114,10 @@ void debug_dip::FinDip()
114114 for( u32 i=0; i<eNOF_CATEGORY; ++i )
115115 {
116116 TCHAR sz_temp[256] = {0};
117- _tcsncpy_s( sz_temp, str_text[i].c_str(), 255 );
118- sz_temp[ _tcscnlen( sz_temp, 256 ) - 1 ] = '\0';
119- //最後の改行文字を消しつつNULL文字を連続させる
117+ wsprintf( sz_temp, _T( "%s\0\0" ), str_text[i].c_str() );
118+ sz_temp[ _tcscnlen( sz_temp, 256 ) - 1 ] = _T( '\0' );
120119
121- const b32 ret =
120+ cb32 ret =
122121 WritePrivateProfileSection(
123122 g_szDebugDipCategoryTbl[i],
124123 sz_temp, sz_path
--- a/core/src/core/debug/debug_dip/debug_dip_def.h
+++ b/core/src/core/debug/debug_dip/debug_dip_def.h
@@ -15,8 +15,8 @@ DEBUG_DIP_ITEM( PLAYER, NO_DAMAGE, "
1515 DEBUG_DIP_ITEM( PLAYER, NO_HIT, "攻撃を受けない" )
1616
1717 ///system
18-DEBUG_DIP_ITEM( SYSTEM, DRAW_FPS, "FPS表示" )
19-DEBUG_DIP_ITEM( SYSTEM, PROC_NOT_ONLY_FOCUSING, "フォーカスが外れても中断しない" )
18+DEBUG_DIP_ITEM( SYSTEM, DRAW_FPS, "FPS表示" )
19+DEBUG_DIP_ITEM( SYSTEM, PROC_ONLY_FOCUSING, "フォーカスが外れたら中断する" )
2020
2121 ///graphic
2222 DEBUG_DIP_ITEM( GRAPHIC, NOT_RENDER_MODEL, "キャラモデルを描画しない" )
--- a/core/src/core/pch_core.h
+++ b/core/src/core/pch_core.h
@@ -30,6 +30,9 @@
3030 #include "util/mm/mm.h"
3131 #include "util/util.h"
3232
33+#include "core/debug/debug_dip/debug_dip.h"
34+using namespace debug_dip;
35+
3336 ///-- "grobal var"
3437 class crender;
3538 extern crender *g_p_render;