Changeset 221 for trunk/src


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

Complete Lol Engine / Deus Hax / Monsterz split.

Location:
trunk/src
Files:
44 edited

Legend:

Unmodified
Added
Removed
  • 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.