Changeset 221 for trunk/monsterz


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

Complete Lol Engine / Deus Hax / Monsterz split.

Location:
trunk/monsterz
Files:
2 edited
2 copied
2 moved

Legend:

Unmodified
Added
Removed
  • 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())
Note: See TracChangeset for help on using the changeset viewer.