瀏覽代碼

Spawn several pieces in Monsterz now that we can.

legacy
Sam Hocevar sam 14 年之前
父節點
當前提交
921aab2993
共有 3 個文件被更改,包括 16 次插入8 次删除
  1. +12
    -6
      src/debugfps.cpp
  2. +1
    -1
      src/debugfps.h
  3. +3
    -1
      win32/monsterz.vcxproj

+ 12
- 6
src/debugfps.cpp 查看文件

@@ -26,6 +26,7 @@ class DebugFpsData
friend class DebugFps;

private:
int x, y;
int fontid;
};

@@ -33,11 +34,13 @@ private:
* Public DebugFps class
*/

DebugFps::DebugFps()
DebugFps::DebugFps(int x, int y)
{
data = new DebugFpsData();

data->fontid = Forge::Register("gfx/font/ascii.png");
data->x = x;
data->y = y;

drawgroup = DRAWGROUP_HUD;
}
@@ -49,30 +52,33 @@ void DebugFps::TickDraw(float deltams)
char buf[1024];
Font *font = Forge::GetFont(data->fontid);

int x = data->x;
int y = data->y;

sprintf(buf, "%2.2f fps (%i)",
1e3f / Profiler::GetAvg(Profiler::STAT_TICK_FRAME),
Ticker::GetFrameNum());
font->PrintBold(10, 10, buf);
font->PrintBold(x, y, buf);

sprintf(buf, "Game % 7.2f % 7.2f",
Profiler::GetAvg(Profiler::STAT_TICK_GAME),
Profiler::GetMax(Profiler::STAT_TICK_GAME));
font->PrintBold(10, 34, buf);
font->PrintBold(x, y + 24, buf);

sprintf(buf, "Draw % 7.2f % 7.2f",
Profiler::GetAvg(Profiler::STAT_TICK_DRAW),
Profiler::GetMax(Profiler::STAT_TICK_DRAW));
font->PrintBold(10, 50, buf);
font->PrintBold(x, y + 40, buf);

sprintf(buf, "Blit % 7.2f % 7.2f",
Profiler::GetAvg(Profiler::STAT_TICK_BLIT),
Profiler::GetMax(Profiler::STAT_TICK_BLIT));
font->PrintBold(10, 66, buf);
font->PrintBold(x, y + 56, buf);

sprintf(buf, "Frame % 7.2f % 7.2f",
Profiler::GetAvg(Profiler::STAT_TICK_FRAME),
Profiler::GetMax(Profiler::STAT_TICK_FRAME));
font->PrintBold(10, 82, buf);
font->PrintBold(x, y + 72, buf);
}

DebugFps::~DebugFps()


+ 1
- 1
src/debugfps.h 查看文件

@@ -23,7 +23,7 @@ class DebugFpsData;
class DebugFps : public Entity
{
public:
DebugFps();
DebugFps(int x, int y);
virtual ~DebugFps();

protected:


+ 3
- 1
win32/monsterz.vcxproj 查看文件

@@ -13,6 +13,7 @@
<ItemGroup>
<ClInclude Include="..\monsterz\board.h" />
<ClInclude Include="..\monsterz\game.h" />
<ClInclude Include="..\monsterz\piece.h" />
<ClInclude Include="..\src\bitfield.h" />
<ClInclude Include="..\src\core.h" />
<ClInclude Include="..\src\debugfps.h" />
@@ -41,6 +42,7 @@
<ClCompile Include="..\monsterz\board.cpp" />
<ClCompile Include="..\monsterz\game.cpp" />
<ClCompile Include="..\monsterz\monsterz.cpp" />
<ClCompile Include="..\monsterz\piece.cpp" />
<ClCompile Include="..\src\debugfps.cpp" />
<ClCompile Include="..\src\debugrecord.cpp" />
<ClCompile Include="..\src\debugsphere.cpp" />
@@ -136,4 +138,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

Loading…
取消
儲存