Changeset 227
- Timestamp:
- Jan 18, 2011, 5:58:13 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/deushax/deushax.cpp
r221 r227 62 62 /* Register an input driver and some debug stuff */ 63 63 new SdlInput(); 64 new DebugFps( );64 new DebugFps(10, 10); 65 65 new DebugSprite(game); 66 66 new DebugSphere(); -
trunk/monsterz/board.cpp
r226 r227 50 50 for (int i = 0; i < 8; i++) 51 51 { 52 data->pieces[j][i] = new Piece(game); 52 int id = (35 + i + (i ^ j + 13) * (2 * j + 711)) % 9; 53 data->pieces[j][i] = new Piece(game, i, j, 25 + 5 * id); 53 54 Ticker::Ref(data->pieces[j][i]); 54 55 } -
trunk/monsterz/monsterz.cpp
r223 r227 63 63 new SdlInput(); 64 64 new Board(game); 65 new DebugFps( );65 new DebugFps(460, 20); 66 66 67 67 while (!Ticker::Finished()) -
trunk/monsterz/piece.cpp
r226 r227 31 31 Game *game; 32 32 int tiler; 33 int x, y;33 int i, j, id; 34 34 }; 35 35 … … 38 38 */ 39 39 40 Piece::Piece(Game *game )40 Piece::Piece(Game *game, int i, int j, int id) 41 41 { 42 42 data = new PieceData(); … … 44 44 Ticker::Ref(game); 45 45 data->tiler = Tiler::Register(PNG_TILES, 48, 48, 1.0f); 46 data->i = i; 47 data->j = j; 48 data->id = id; 46 49 } 47 50 … … 55 58 Entity::TickDraw(deltams); 56 59 57 int id = 25; 60 int id = data->id; 61 int i = data->i; 62 int j = data->j; 58 63 data->game->GetScene()->AddTile((data->tiler << 16) | id, 59 data->x + 24, data->y+ 177, 2, 0);64 i * 48 + 24, j * 48 + 177, 2, 0); 60 65 } 61 66 -
trunk/monsterz/piece.h
r226 r227 20 20 { 21 21 public: 22 Piece(Game *game );22 Piece(Game *game, int i, int j, int id); 23 23 virtual ~Piece(); 24 24 -
trunk/src/debugfps.cpp
r221 r227 27 27 28 28 private: 29 int x, y; 29 30 int fontid; 30 31 }; … … 34 35 */ 35 36 36 DebugFps::DebugFps( )37 DebugFps::DebugFps(int x, int y) 37 38 { 38 39 data = new DebugFpsData(); 39 40 40 41 data->fontid = Forge::Register("gfx/font/ascii.png"); 42 data->x = x; 43 data->y = y; 41 44 42 45 drawgroup = DRAWGROUP_HUD; … … 50 53 Font *font = Forge::GetFont(data->fontid); 51 54 55 int x = data->x; 56 int y = data->y; 57 52 58 sprintf(buf, "%2.2f fps (%i)", 53 59 1e3f / Profiler::GetAvg(Profiler::STAT_TICK_FRAME), 54 60 Ticker::GetFrameNum()); 55 font->PrintBold( 10, 10, buf);61 font->PrintBold(x, y, buf); 56 62 57 63 sprintf(buf, "Game % 7.2f % 7.2f", 58 64 Profiler::GetAvg(Profiler::STAT_TICK_GAME), 59 65 Profiler::GetMax(Profiler::STAT_TICK_GAME)); 60 font->PrintBold( 10, 34, buf);66 font->PrintBold(x, y + 24, buf); 61 67 62 68 sprintf(buf, "Draw % 7.2f % 7.2f", 63 69 Profiler::GetAvg(Profiler::STAT_TICK_DRAW), 64 70 Profiler::GetMax(Profiler::STAT_TICK_DRAW)); 65 font->PrintBold( 10, 50, buf);71 font->PrintBold(x, y + 40, buf); 66 72 67 73 sprintf(buf, "Blit % 7.2f % 7.2f", 68 74 Profiler::GetAvg(Profiler::STAT_TICK_BLIT), 69 75 Profiler::GetMax(Profiler::STAT_TICK_BLIT)); 70 font->PrintBold( 10, 66, buf);76 font->PrintBold(x, y + 56, buf); 71 77 72 78 sprintf(buf, "Frame % 7.2f % 7.2f", 73 79 Profiler::GetAvg(Profiler::STAT_TICK_FRAME), 74 80 Profiler::GetMax(Profiler::STAT_TICK_FRAME)); 75 font->PrintBold( 10, 82, buf);81 font->PrintBold(x, y + 72, buf); 76 82 } 77 83 -
trunk/src/debugfps.h
r221 r227 24 24 { 25 25 public: 26 DebugFps( );26 DebugFps(int x, int y); 27 27 virtual ~DebugFps(); 28 28 -
trunk/win32/monsterz.vcxproj
r224 r227 14 14 <ClInclude Include="..\monsterz\board.h" /> 15 15 <ClInclude Include="..\monsterz\game.h" /> 16 <ClInclude Include="..\monsterz\piece.h" /> 16 17 <ClInclude Include="..\src\bitfield.h" /> 17 18 <ClInclude Include="..\src\core.h" /> … … 42 43 <ClCompile Include="..\monsterz\game.cpp" /> 43 44 <ClCompile Include="..\monsterz\monsterz.cpp" /> 45 <ClCompile Include="..\monsterz\piece.cpp" /> 44 46 <ClCompile Include="..\src\debugfps.cpp" /> 45 47 <ClCompile Include="..\src\debugrecord.cpp" />
Note: See TracChangeset
for help on using the changeset viewer.