Browse Source

debug: add minor debug messages to the ticker, ensure LOL_DEBUG and

LOL_RELEASE are set by msbuild, and use the debug PSGL on the PS3.
legacy
Sam Hocevar sam 12 years ago
parent
commit
5f137d077c
3 changed files with 27 additions and 3 deletions
  1. +2
    -2
      build/vs2010/Lol.Core.Rules.props
  2. +2
    -1
      build/vs2010/Lol.Core.Vars.props
  3. +23
    -0
      src/ticker.cpp

+ 2
- 2
build/vs2010/Lol.Core.Rules.props View File

@@ -24,7 +24,7 @@
<Optimization>Disabled</Optimization>
<RuntimeLibrary Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">MultiThreadedDebugDLL</RuntimeLibrary>
<RuntimeLibrary Condition="'$(Platform)'=='Xbox 360'">MultiThreadedDebug</RuntimeLibrary>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;LOL_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Condition="'$(Configuration)'=='Release'">
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -38,7 +38,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;LOL_RELEASE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>

<Link>


+ 2
- 1
build/vs2010/Lol.Core.Vars.props View File

@@ -50,7 +50,8 @@
<GlIncludes>$(GlewDir)\include\GL</GlIncludes>
<GlLibs Condition="'$(Platform)'=='Win32'">$(GlewDir)\lib\i686-w64-mingw32</GlLibs>
<GlLibs Condition="'$(Platform)'=='x64'">$(GlewDir)\lib\x86_64-w64-mingw32</GlLibs>
<GlLibs Condition="'$(Platform)'=='PS3'">$(SCE_PS3_ROOT)\target\ppu\lib\PSGL\RSX\opt</GlLibs>
<GlLibs Condition="'$(Platform)|$(Configuration)'=='PS3|Debug'">$(SCE_PS3_ROOT)\target\ppu\lib\PSGL\RSX\debug</GlLibs>
<GlLibs Condition="'$(Platform)|$(Configuration)'=='PS3|Release'">$(SCE_PS3_ROOT)\target\ppu\lib\PSGL\RSX\opt</GlLibs>
<GlDeps Condition="'$(Platform)'=='Win32'">opengl32.lib;glew32.lib</GlDeps>
<GlDeps Condition="'$(Platform)'=='x64'">opengl32.lib;glew32.lib</GlDeps>
<GlDeps Condition="'$(Platform)'=='PS3'">libPSGL.a;libgcm_cmd.a;libgcm_sys_stub.a;libcgc.a;libPSGLcgc.a</GlDeps>


+ 23
- 0
src/ticker.cpp View File

@@ -33,6 +33,9 @@ public:
todolist(0), autolist(0),
nentities(0),
frame(0), recording(0), deltatime(0), bias(0), fps(0),
#if LOL_DEBUG
keepalive(0),
#endif
quit(0), quitframe(0), quitdelay(20), panic(0)
{
for (int i = 0; i < Entity::ALLGROUP_END; i++)
@@ -70,6 +73,9 @@ private:
int frame, recording;
Timer timer;
float deltatime, bias, fps;
#if LOL_DEBUG
float keepalive;
#endif

/* Background threads */
static void *GameThreadMain(void *p);
@@ -154,6 +160,10 @@ int Ticker::Unref(Entity *entity)

void *TickerData::GameThreadMain(void * /* p */)
{
#if LOL_DEBUG
Log::Info("ticker game thread initialised\n");
#endif

for (;;)
{
int tick = data->gametick.Pop();
@@ -200,6 +210,15 @@ void *TickerData::GameThreadMain(void * /* p */)
data->bias = 0.f;
}

#if LOL_DEBUG
data->keepalive += data->deltatime;
if (data->keepalive > 10.f)
{
Log::Info("ticker keepalive: tick!\n");
data->keepalive = 0.f;
}
#endif

/* If shutdown is stuck, kick the first entity we meet and see
* whether it makes things better. Note that it is always a bug to
* have referenced entities after 20 frames, but at least this
@@ -303,6 +322,10 @@ void *TickerData::GameThreadMain(void * /* p */)

data->drawtick.Push(0);

#if LOL_DEBUG
Log::Info("ticker game thread terminated\n");
#endif

return NULL;
}



Loading…
Cancel
Save