Changeset 221 for trunk


Ignore:
Timestamp:
Jan 18, 2011, 12:05:18 AM (9 years ago)
Author:
sam
Message:

Complete Lol Engine / Deus Hax / Monsterz split.

Location:
trunk
Files:
51 edited
2 copied
6 moved

Legend:

Unmodified
Added
Removed
  • trunk/.gitignore

    r220 r221  
    2323stamp-*
    2424*-stamp
    25 deushax-*.tar.*
     25lolengine-*.tar.*
    2626# Debugging cruft
    2727core
  • trunk/configure.ac

    r220 r221  
    11# $Id$
    22
    3 AC_INIT(deushax, 0.0)
     3AC_INIT(lolengine, 0.0)
    44AC_PREREQ(2.50)
    55AC_CONFIG_AUX_DIR(.auto)
  • trunk/deushax/Makefile.am

    r220 r221  
    22noinst_PROGRAMS = deushax editor
    33
    4 deushax_SOURCES = deushax.cpp
     4deushax_SOURCES = deushax.cpp game.cpp game.h debugsprite.cpp debugsprite.h
    55deushax_CXXFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@
    66deushax_LDADD = $(top_builddir)/src/liblol.a
  • trunk/deushax/debugsprite.cpp

    r220 r221  
    11//
    22// Deus Hax (working title)
    3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
     3// Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
    44//
    55
     
    3737    data->game = game;
    3838    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);
    4040    data->x = 320;
    4141    data->y = 206;
  • trunk/deushax/deushax.cpp

    r220 r221  
    11//
    22// Deus Hax (working title)
    3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
     3// Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
    44//
    55
     
    1717
    1818#include "core.h"
     19#include "game.h"
    1920#include "sdlinput.h"
    2021#include "debugfps.h"
    21 #include "debugboard.h"
    2222#include "debugsprite.h"
    2323#include "debugsphere.h"
     
    6464    new DebugFps();
    6565    new DebugSprite(game);
    66     new DebugBoard(game);
    6766    new DebugSphere();
    6867    //new DebugRecord("lolengine.ogg");
  • trunk/deushax/game.cpp

    r220 r221  
    11//
    22// Deus Hax (working title)
    3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
     3// Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
    44//
    55
     
    1111
    1212#include "core.h"
     13#include "game.h"
    1314
    1415/*
  • trunk/deushax/gtk/editor.cpp

    r220 r221  
    11//
    22// Deus Hax (working title)
    3 // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
     3// Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
    44//
    55
     
    4040    /* Build the application interface */
    4141    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))
    4343    {
    4444        g_print("Cannot build from XML\n");
  • trunk/monsterz/Makefile.am

    r220 r221  
    22noinst_PROGRAMS = monsterz
    33
    4 monsterz_SOURCES = monsterz.cpp
     4monsterz_SOURCES = monsterz.cpp game.cpp game.h debugboard.cpp debugboard.h
    55monsterz_CXXFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@
    66monsterz_LDADD = $(top_builddir)/src/liblol.a
  • trunk/monsterz/debugboard.cpp

    • Property svn:keywords set to Id
    r220 r221  
    11//
    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.
    49//
    510
     
    2429private:
    2530    Game *game;
    26     int tiler;
    27     float x, y, z;
     31    int background, board, tiler;
    2832};
    2933
     
    3741    data->game = game;
    3842    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);
    4346}
    4447
     
    5255    Entity::TickDraw(deltams);
    5356
    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);
    5759
    5860    for (int j = 0; j < 8; j++)
     
    6264        id += (id % 5) / 4;
    6365        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);
    6567    }
    6668}
     
    7072    Ticker::Unref(data->game);
    7173    Tiler::Deregister(data->tiler);
     74    Tiler::Deregister(data->board);
     75    Tiler::Deregister(data->background);
    7276    delete data;
    7377}
  • trunk/monsterz/debugboard.h

    • Property svn:keywords set to Id
  • trunk/monsterz/game.cpp

    r220 r221  
    11//
    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.
    49//
    510
     
    1116
    1217#include "core.h"
     18#include "game.h"
    1319
    1420/*
     
    2127
    2228private:
    23     Map *map;
    2429    int x, y;
    2530    int mousex, mousey;
     
    3338 */
    3439
    35 Game::Game(char const *mapname)
     40Game::Game()
    3641{
    3742    data = new GameData();
    38     data->map = new Map(mapname);
    3943    data->x = data->y = 0;
    4044    data->done = 0;
     
    4448Game::~Game()
    4549{
    46     delete data->map;
    4750    delete data;
    4851}
     
    5962    GetScene();
    6063
    61     data->map->Render(data->scene, -data->mousex, -data->mousey, 0);
    6264    data->scene->Render();
    6365
  • trunk/monsterz/game.h

    r220 r221  
    2020{
    2121public:
    22     Game(char const *mapname);
     22    Game();
    2323    ~Game();
    2424
  • trunk/monsterz/monsterz.cpp

    r220 r221  
    11//
    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.
    49//
    510
     
    1722
    1823#include "core.h"
     24#include "game.h"
    1925#include "sdlinput.h"
    2026#include "debugfps.h"
    2127#include "debugboard.h"
    22 #include "debugsprite.h"
    23 #include "debugsphere.h"
    24 #include "debugrecord.h"
    25 #include "debugstats.h"
    2628
    2729static float const FPS = 30.0f;
     
    4648    }
    4749
    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);
    5151
    5252    /* Initialise OpenGL */
     
    5757    _chdir(".."); /* Temporary Win32 hack */
    5858#endif
    59     Game *game = new Game("maps/testmap.tmx");
    60     game->SetMouse(160, 96);
     59    Game *game = new Game();
    6160
    6261    /* Register an input driver and some debug stuff */
    6362    new SdlInput();
    6463    new DebugFps();
    65     new DebugSprite(game);
    6664    new DebugBoard(game);
    67     new DebugSphere();
    68     //new DebugRecord("lolengine.ogg");
    69     new DebugStats("stats.txt");
    7065
    7166    while (!Ticker::Finished())
  • trunk/src/Makefile.am

    r220 r221  
    33
    44liblol_a_SOURCES = \
    5     core.h matrix.h game.cpp game.h tiler.cpp tiler.h dict.cpp dict.h \
     5    core.h matrix.h tiler.cpp tiler.h dict.cpp dict.h \
    66    scene.cpp scene.h font.cpp font.h layer.cpp layer.h map.cpp map.h \
    77    entity.cpp entity.h ticker.cpp ticker.h tileset.cpp tileset.h \
     
    1111    sdlinput.cpp sdlinput.h \
    1212    \
    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
    1615liblol_a_CXXFLAGS = `pkg-config --cflags sdl gl SDL_image`
    1716
  • trunk/src/bitfield.h

    r180 r221  
    11//
    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.
    49//
    510
  • trunk/src/core.h

    r220 r221  
    11//
    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.
    49//
    510
     
    2530#include "entity.h"
    2631#include "font.h"
    27 #include "game.h"
    2832#include "tileset.h"
    2933#include "world.h"
  • trunk/src/debugfps.cpp

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/debugfps.h

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/debugrecord.cpp

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/debugrecord.h

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/debugsphere.cpp

    r215 r221  
    11//
    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.
    49//
    510
  • trunk/src/debugsphere.h

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/debugstats.cpp

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/debugstats.h

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/dict.cpp

    r179 r221  
    11//
    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.
    49//
    510
  • trunk/src/dict.h

    r153 r221  
    11//
    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.
    49//
    510
  • trunk/src/entity.cpp

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/entity.h

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/font.cpp

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/font.h

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/forge.cpp

    r172 r221  
    11//
    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.
    49//
    510
  • trunk/src/forge.h

    r153 r221  
    11//
    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.
    49//
    510
  • trunk/src/input.cpp

    r186 r221  
    11//
    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.
    49//
    510
  • trunk/src/input.h

    r150 r221  
    11//
    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.
    49//
    510
  • trunk/src/layer.cpp

    r205 r221  
    11//
    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.
    49//
    510
  • trunk/src/layer.h

    r133 r221  
    11//
    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.
    49//
    510
  • trunk/src/map.cpp

    r218 r221  
    11//
    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.
    49//
    510
     
    122127        {
    123128            /* 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);
    125130            data->ntilers++;
    126131            //fprintf(stderr, "new tiler %s\n", str);
  • trunk/src/map.h

    r126 r221  
    11//
    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.
    49//
    510
  • trunk/src/matrix.h

    r152 r221  
    11//
    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.
    49//
    510
  • trunk/src/profiler.cpp

    r167 r221  
    11//
    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.
    49//
    510
  • trunk/src/profiler.h

    r154 r221  
    11//
    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.
    49//
    510
  • trunk/src/scene.cpp

    r206 r221  
    11//
    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.
    49//
    510
  • trunk/src/scene.h

    r133 r221  
    11//
    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.
    49//
    510
  • trunk/src/sdlinput.cpp

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/sdlinput.h

    r210 r221  
    11//
    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.
    49//
    510
     
    1318
    1419#include "entity.h"
    15 #include "game.h"
    1620
    1721class SdlInputData;
  • trunk/src/ticker.cpp

    r211 r221  
    11//
    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.
    49//
    510
  • trunk/src/ticker.h

    r170 r221  
    11//
    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.
    49//
    510
  • trunk/src/tiler.cpp

    r218 r221  
    11//
    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.
    49//
    510
     
    2934 */
    3035
    31 int Tiler::Register(char const *path, int size)
     36int Tiler::Register(char const *path, int w, int h)
    3237{
    3338    int id = data->tilesets.MakeSlot(path);
     
    3540    if (!data->tilesets.GetEntity(id))
    3641    {
    37         TileSet *tileset = new TileSet(path, size);
     42        TileSet *tileset = new TileSet(path, w, h);
    3843        data->tilesets.SetEntity(id, tileset);
    3944    }
  • trunk/src/tiler.h

    r218 r221  
    11//
    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.
    49//
    510
     
    1823{
    1924public:
    20     static int Register(char const *path, int size);
     25    static int Register(char const *path, int w, int h);
    2126    static void Deregister(int id);
    2227
  • trunk/src/tileset.cpp

    r218 r221  
    11//
    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.
    49//
    510
     
    3843    char *name;
    3944    int *tiles;
    40     int size, nw, nh, ntiles;
     45    int w, h, nw, nh, ntiles;
    4146    float tx, ty;
    4247
     
    4954 */
    5055
    51 TileSet::TileSet(char const *path, int size)
     56TileSet::TileSet(char const *path, int w, int h)
    5257{
    5358    data = new TileSetData();
     
    6772    }
    6873
    69     if (size <= 0)
    70         size = 32;
     74    if (w <= 0)
     75        w = 32;
     76    if (h <= 0)
     77        h = 32;
    7178
    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;
    7584    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;
    7887
    7988    drawgroup = DRAWGROUP_BEFORE;
     
    100109    else if (data->img)
    101110    {
     111        GLuint format = data->img->format->Amask ? GL_RGBA : GL_RGB;
     112        int planes = data->img->format->Amask ? 4 : 3;
     113
    102114        glGenTextures(1, &data->texture);
    103115        glBindTexture(GL_TEXTURE_2D, data->texture);
    104116
    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);
    107119
    108120        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
     
    125137
    126138    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;
    131143
    132144    if (!data->img)
  • trunk/src/tileset.h

    r218 r221  
    11//
    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.
    49//
    510
     
    2429{
    2530public:
    26     TileSet(char const *path, int size);
     31    TileSet(char const *path, int w, int h);
    2732    virtual ~TileSet();
    2833
  • trunk/src/timer.cpp

    r180 r221  
    11//
    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.
    49//
    510
  • trunk/src/timer.h

    r149 r221  
    11//
    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.
    49//
    510
  • trunk/src/video.cpp

    r216 r221  
    11//
    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.
    49//
    510
  • trunk/src/video.h

    r211 r221  
    11//
    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.
    49//
    510
  • trunk/src/world.cpp

    r210 r221  
    11//
    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.
    49//
    510
  • trunk/src/world.h

    r210 r221  
    11//
    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.
    49//
    510
Note: See TracChangeset for help on using the changeset viewer.