Changeset 221
- Timestamp:
- Jan 18, 2011, 12:05:18 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 51 edited
- 2 copied
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/.gitignore
r220 r221 23 23 stamp-* 24 24 *-stamp 25 deushax-*.tar.*25 lolengine-*.tar.* 26 26 # Debugging cruft 27 27 core -
trunk/configure.ac
r220 r221 1 1 # $Id$ 2 2 3 AC_INIT( deushax, 0.0)3 AC_INIT(lolengine, 0.0) 4 4 AC_PREREQ(2.50) 5 5 AC_CONFIG_AUX_DIR(.auto) -
trunk/deushax/Makefile.am
r220 r221 2 2 noinst_PROGRAMS = deushax editor 3 3 4 deushax_SOURCES = deushax.cpp 4 deushax_SOURCES = deushax.cpp game.cpp game.h debugsprite.cpp debugsprite.h 5 5 deushax_CXXFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ 6 6 deushax_LDADD = $(top_builddir)/src/liblol.a -
trunk/deushax/debugsprite.cpp
r220 r221 1 1 // 2 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>3 // Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net> 4 4 // 5 5 … … 37 37 data->game = game; 38 38 Ticker::Ref(game); 39 data->tiler = Tiler::Register("art/test/character-dress.png", 32 );39 data->tiler = Tiler::Register("art/test/character-dress.png", 32, 32); 40 40 data->x = 320; 41 41 data->y = 206; -
trunk/deushax/deushax.cpp
r220 r221 1 1 // 2 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>3 // Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net> 4 4 // 5 5 … … 17 17 18 18 #include "core.h" 19 #include "game.h" 19 20 #include "sdlinput.h" 20 21 #include "debugfps.h" 21 #include "debugboard.h"22 22 #include "debugsprite.h" 23 23 #include "debugsphere.h" … … 64 64 new DebugFps(); 65 65 new DebugSprite(game); 66 new DebugBoard(game);67 66 new DebugSphere(); 68 67 //new DebugRecord("lolengine.ogg"); -
trunk/deushax/game.cpp
r220 r221 1 1 // 2 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>3 // Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net> 4 4 // 5 5 … … 11 11 12 12 #include "core.h" 13 #include "game.h" 13 14 14 15 /* -
trunk/deushax/gtk/editor.cpp
r220 r221 1 1 // 2 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>3 // Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net> 4 4 // 5 5 … … 40 40 /* Build the application interface */ 41 41 GtkBuilder *builder = gtk_builder_new(); 42 if (!gtk_builder_add_from_file(builder, " src/gtk/editor.xml", NULL))42 if (!gtk_builder_add_from_file(builder, "deushax/gtk/editor.xml", NULL)) 43 43 { 44 44 g_print("Cannot build from XML\n"); -
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()) -
trunk/src/Makefile.am
r220 r221 3 3 4 4 liblol_a_SOURCES = \ 5 core.h matrix.h game.cpp game.htiler.cpp tiler.h dict.cpp dict.h \5 core.h matrix.h tiler.cpp tiler.h dict.cpp dict.h \ 6 6 scene.cpp scene.h font.cpp font.h layer.cpp layer.h map.cpp map.h \ 7 7 entity.cpp entity.h ticker.cpp ticker.h tileset.cpp tileset.h \ … … 11 11 sdlinput.cpp sdlinput.h \ 12 12 \ 13 debugfps.cpp debugfps.h debugsprite.cpp debugsprite.h \ 14 debugrecord.cpp debugrecord.h debugstats.cpp debugstats.h \ 15 debugsphere.cpp debugsphere.h debugboard.cpp debugboard.h 13 debugfps.cpp debugfps.h debugsphere.cpp debugsphere.h \ 14 debugrecord.cpp debugrecord.h debugstats.cpp debugstats.h 16 15 liblol_a_CXXFLAGS = `pkg-config --cflags sdl gl SDL_image` 17 16 -
trunk/src/bitfield.h
r180 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/core.h
r220 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 … … 25 30 #include "entity.h" 26 31 #include "font.h" 27 #include "game.h"28 32 #include "tileset.h" 29 33 #include "world.h" -
trunk/src/debugfps.cpp
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/debugfps.h
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/debugrecord.cpp
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/debugrecord.h
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/debugsphere.cpp
r215 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/debugsphere.h
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/debugstats.cpp
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/debugstats.h
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/dict.cpp
r179 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/dict.h
r153 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/entity.cpp
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/entity.h
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/font.cpp
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/font.h
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/forge.cpp
r172 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/forge.h
r153 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/input.cpp
r186 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/input.h
r150 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/layer.cpp
r205 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/layer.h
r133 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/map.cpp
r218 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 … … 122 127 { 123 128 /* This is a tileset image file. Associate it with firstgid. */ 124 data->tilers[data->ntilers] = Tiler::Register(str, 32 );129 data->tilers[data->ntilers] = Tiler::Register(str, 32, 32); 125 130 data->ntilers++; 126 131 //fprintf(stderr, "new tiler %s\n", str); -
trunk/src/map.h
r126 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/matrix.h
r152 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/profiler.cpp
r167 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/profiler.h
r154 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/scene.cpp
r206 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/scene.h
r133 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/sdlinput.cpp
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/sdlinput.h
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 … … 13 18 14 19 #include "entity.h" 15 #include "game.h"16 20 17 21 class SdlInputData; -
trunk/src/ticker.cpp
r211 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/ticker.h
r170 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/tiler.cpp
r218 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 … … 29 34 */ 30 35 31 int Tiler::Register(char const *path, int size)36 int Tiler::Register(char const *path, int w, int h) 32 37 { 33 38 int id = data->tilesets.MakeSlot(path); … … 35 40 if (!data->tilesets.GetEntity(id)) 36 41 { 37 TileSet *tileset = new TileSet(path, size);42 TileSet *tileset = new TileSet(path, w, h); 38 43 data->tilesets.SetEntity(id, tileset); 39 44 } -
trunk/src/tiler.h
r218 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 … … 18 23 { 19 24 public: 20 static int Register(char const *path, int size);25 static int Register(char const *path, int w, int h); 21 26 static void Deregister(int id); 22 27 -
trunk/src/tileset.cpp
r218 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 … … 38 43 char *name; 39 44 int *tiles; 40 int size, nw, nh, ntiles;45 int w, h, nw, nh, ntiles; 41 46 float tx, ty; 42 47 … … 49 54 */ 50 55 51 TileSet::TileSet(char const *path, int size)56 TileSet::TileSet(char const *path, int w, int h) 52 57 { 53 58 data = new TileSetData(); … … 67 72 } 68 73 69 if (size <= 0) 70 size = 32; 74 if (w <= 0) 75 w = 32; 76 if (h <= 0) 77 h = 32; 71 78 72 data->size = size; 73 data->nw = data->img->w / size; 74 data->nh = data->img->h / size; 79 data->w = w; 80 data->h = h; 81 /* FIXME: check for non-zero here */ 82 data->nw = data->img->w / w; 83 data->nh = data->img->h / h; 75 84 data->ntiles = data->nw * data->nh; 76 data->tx = (float) size/ data->img->w;77 data->ty = (float) size/ data->img->h;85 data->tx = (float)w / data->img->w; 86 data->ty = (float)h / data->img->h; 78 87 79 88 drawgroup = DRAWGROUP_BEFORE; … … 100 109 else if (data->img) 101 110 { 111 GLuint format = data->img->format->Amask ? GL_RGBA : GL_RGB; 112 int planes = data->img->format->Amask ? 4 : 3; 113 102 114 glGenTextures(1, &data->texture); 103 115 glBindTexture(GL_TEXTURE_2D, data->texture); 104 116 105 glTexImage2D(GL_TEXTURE_2D, 0, 4, data->img->w, data->img->h, 0,106 GL_RGBA, GL_UNSIGNED_BYTE, data->img->pixels);117 glTexImage2D(GL_TEXTURE_2D, 0, planes, data->img->w, data->img->h, 0, 118 format, GL_UNSIGNED_BYTE, data->img->pixels); 107 119 108 120 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); … … 125 137 126 138 float sqrt2 = sqrtf(2.0f); 127 int off = o ? data-> size: 0;128 int dx = data-> size;129 int dy = data-> size* 38 / 32; /* Magic... fix this one day */130 int dy2 = data-> size* 70 / 32;139 int off = o ? data->h : 0; 140 int dx = data->w; 141 int dy = data->h * 38 / 32; /* Magic... fix this one day */ 142 int dy2 = data->h * 70 / 32; 131 143 132 144 if (!data->img) -
trunk/src/tileset.h
r218 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 { 25 30 public: 26 TileSet(char const *path, int size);31 TileSet(char const *path, int w, int h); 27 32 virtual ~TileSet(); 28 33 -
trunk/src/timer.cpp
r180 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/timer.h
r149 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/video.cpp
r216 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/video.h
r211 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/world.cpp
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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 -
trunk/src/world.h
r210 r221 1 1 // 2 // Deus Hax (working title) 3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net> 2 // Lol Engine 3 // 4 // Copyright: (c) 2010-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
Note: See TracChangeset
for help on using the changeset viewer.