Changeset 221 for trunk/monsterz
- Timestamp:
- Jan 18, 2011, 12:05:18 AM (12 years ago)
- Location:
- trunk/monsterz
- Files:
-
- 2 edited
- 2 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/monsterz/Makefile.am
r220 r221 2 2 noinst_PROGRAMS = monsterz 3 3 4 monsterz_SOURCES = monsterz.cpp 4 monsterz_SOURCES = monsterz.cpp game.cpp game.h debugboard.cpp debugboard.h 5 5 monsterz_CXXFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ 6 6 monsterz_LDADD = $(top_builddir)/src/liblol.a -
trunk/monsterz/debugboard.cpp
-
Property
svn:keywords
set to
Id
r220 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net> 2 // Monsterz 3 // 4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net> 5 // This program is free software; you can redistribute it and/or 6 // modify it under the terms of the Do What The Fuck You Want To 7 // Public License, Version 2, as published by Sam Hocevar. See 8 // http://sam.zoy.org/projects/COPYING.WTFPL for more details. 4 9 // 5 10 … … 24 29 private: 25 30 Game *game; 26 int tiler; 27 float x, y, z; 31 int background, board, tiler; 28 32 }; 29 33 … … 37 41 data->game = game; 38 42 Ticker::Ref(game); 39 data->tiler = Tiler::Register("monsterz/tiles.png", 48); 40 data->x = 32; 41 data->y = 0; 42 data->z = 112; 43 data->background = Tiler::Register("monsterz/background.png", 640, 480); 44 data->board = Tiler::Register("monsterz/board.png", 384, 384); 45 data->tiler = Tiler::Register("monsterz/tiles.png", 48, 48); 43 46 } 44 47 … … 52 55 Entity::TickDraw(deltams); 53 56 54 int x = data->x; 55 int y = data->y; 56 int z = data->z; 57 data->game->GetScene()->AddTile((data->background << 16) | 0, 0, 980, 0, 0); 58 data->game->GetScene()->AddTile((data->board << 16) | 0, 24, 841, 1, 0); 57 59 58 60 for (int j = 0; j < 8; j++) … … 62 64 id += (id % 5) / 4; 63 65 data->game->GetScene()->AddTile((data->tiler << 16) | id, 64 x + i * 48 - 16, y + j * 48, z, 1);66 i * 48 + 24, j * 48 + 107, 0, 1); 65 67 } 66 68 } … … 70 72 Ticker::Unref(data->game); 71 73 Tiler::Deregister(data->tiler); 74 Tiler::Deregister(data->board); 75 Tiler::Deregister(data->background); 72 76 delete data; 73 77 } -
Property
svn:keywords
set to
-
trunk/monsterz/debugboard.h
-
Property
svn:keywords
set to
Id
-
Property
svn:keywords
set to
-
trunk/monsterz/game.cpp
r220 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Monsterz 3 // 4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net> 5 // This program is free software; you can redistribute it and/or 6 // modify it under the terms of the Do What The Fuck You Want To 7 // Public License, Version 2, as published by Sam Hocevar. See 8 // http://sam.zoy.org/projects/COPYING.WTFPL for more details. 4 9 // 5 10 … … 11 16 12 17 #include "core.h" 18 #include "game.h" 13 19 14 20 /* … … 21 27 22 28 private: 23 Map *map;24 29 int x, y; 25 30 int mousex, mousey; … … 33 38 */ 34 39 35 Game::Game( char const *mapname)40 Game::Game() 36 41 { 37 42 data = new GameData(); 38 data->map = new Map(mapname);39 43 data->x = data->y = 0; 40 44 data->done = 0; … … 44 48 Game::~Game() 45 49 { 46 delete data->map;47 50 delete data; 48 51 } … … 59 62 GetScene(); 60 63 61 data->map->Render(data->scene, -data->mousex, -data->mousey, 0);62 64 data->scene->Render(); 63 65 -
trunk/monsterz/game.h
r220 r221 20 20 { 21 21 public: 22 Game( char const *mapname);22 Game(); 23 23 ~Game(); 24 24 -
trunk/monsterz/monsterz.cpp
r220 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Monsterz 3 // 4 // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net> 5 // This program is free software; you can redistribute it and/or 6 // modify it under the terms of the Do What The Fuck You Want To 7 // Public License, Version 2, as published by Sam Hocevar. See 8 // http://sam.zoy.org/projects/COPYING.WTFPL for more details. 4 9 // 5 10 … … 17 22 18 23 #include "core.h" 24 #include "game.h" 19 25 #include "sdlinput.h" 20 26 #include "debugfps.h" 21 27 #include "debugboard.h" 22 #include "debugsprite.h"23 #include "debugsphere.h"24 #include "debugrecord.h"25 #include "debugstats.h"26 28 27 29 static float const FPS = 30.0f; … … 46 48 } 47 49 48 SDL_WM_SetCaption("Map Test (SDL)", NULL); 49 SDL_ShowCursor(0); 50 //SDL_WM_GrabInput(SDL_GRAB_ON); 50 SDL_WM_SetCaption("Monsterz", NULL); 51 51 52 52 /* Initialise OpenGL */ … … 57 57 _chdir(".."); /* Temporary Win32 hack */ 58 58 #endif 59 Game *game = new Game("maps/testmap.tmx"); 60 game->SetMouse(160, 96); 59 Game *game = new Game(); 61 60 62 61 /* Register an input driver and some debug stuff */ 63 62 new SdlInput(); 64 63 new DebugFps(); 65 new DebugSprite(game);66 64 new DebugBoard(game); 67 new DebugSphere();68 //new DebugRecord("lolengine.ogg");69 new DebugStats("stats.txt");70 65 71 66 while (!Ticker::Finished())
Note: See TracChangeset
for help on using the changeset viewer.