Changeset 862


Ignore:
Timestamp:
Aug 26, 2011, 7:20:39 PM (8 years ago)
Author:
sam
Message:

core: add a Sprite class to try to factor some common logic currently
found in the game. Will be greatly improved later.

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/title.cpp

    r860 r862  
    4444    TileSet *event[7];
    4545
     46    Sprite *logo_sprite;
     47
    4648    enum
    4749    {
     
    138140
    139141    data->logo = Tiler::Register(PNG_TITLE_LOGO, vec2i(380, 181), 0, 1.0f);
     142    data->logo_sprite = new Sprite(data->logo, 0);
     143    data->logo_sprite->position = vec3(26, 250, 3);
     144    Ticker::Ref(data->logo_sprite);
     145
    140146    data->ground = Tiler::Register(PNG_TITLE_GROUND, vec2i(384, 80), 0, 1.0f);
    141147    data->ground_pos = vec2i((vec2)(bbox[1] - bbox[0]) / vec2i(2, 4))
     
    375381                                     vec3i(data->ground_pos.x + pos.x,
    376382                                           data->ground_pos.y + pos.y, 1), 0);
    377 
    378     /* The logo, on top of the rest. */
    379     Scene::GetDefault()->AddTile(data->logo, 0, vec3i(26, 250, 3), 0);
    380383}
    381384
     
    389392    Input::UntrackMouse(this);
    390393    Tiler::Deregister(data->logo);
     394    Ticker::Unref(data->logo_sprite);
    391395    Tiler::Deregister(data->ground);
    392396    Tiler::Deregister(data->title);
  • trunk/src/Makefile.am

    r860 r862  
    1111    text.cpp text.h emitter.cpp emitter.h numeric.h hash.cpp hash.h \
    1212    worldentity.cpp worldentity.h image.cpp image.h gradient.cpp gradient.h \
    13     platform.cpp platform.h \
     13    platform.cpp platform.h sprite.cpp sprite.h \
    1414    \
    1515    sdlapp.cpp sdlapp.h sdlinput.cpp sdlinput.h \
  • trunk/src/core.h

    r860 r862  
    3939#include "gradient.h"
    4040#include "sample.h"
     41#include "sprite.h"
    4142#include "text.h"
    4243#include "tileset.h"
Note: See TracChangeset for help on using the changeset viewer.