Changeset 787


Ignore:
Timestamp:
Jun 26, 2011, 12:52:04 AM (10 years ago)
Author:
sam
Message:

tiler: Tiler::GetSize can now return a different value for different tiles.

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/font.cpp

    r758 r787  
    4848
    4949    data->tiler = Tiler::Register(path, 0, 16, 1.0f);
    50     data->size = Tiler::GetSize(data->tiler);
     50    data->size = Tiler::GetSize(data->tiler, 0);
    5151
    5252    drawgroup = DRAWGROUP_BEFORE;
  • trunk/src/tiler.cpp

    r735 r787  
    6969}
    7070
    71 vec2i Tiler::GetSize(int id)
    72 {
    73     TileSet *tileset = (TileSet *)data->tilesets.GetEntity(id - 1);
    74 #if !LOL_RELEASE
    75     if (!tileset)
    76     {
    77         Log::Error("getting size for null tiler #%i\n", id);
    78         return 0;
    79     }
    80 #endif
    81     return tileset->GetSize();
    82 }
    83 
    8471vec2i Tiler::GetCount(int id)
    8572{
     
    9380#endif
    9481    return tileset->GetCount();
     82}
     83
     84vec2i Tiler::GetSize(int id, int tileid)
     85{
     86    TileSet *tileset = (TileSet *)data->tilesets.GetEntity(id - 1);
     87#if !LOL_RELEASE
     88    if (!tileset)
     89    {
     90        Log::Error("getting size for null tiler #%i\n", id);
     91        return 0;
     92    }
     93#endif
     94    return tileset->GetSize(tileid);
    9595}
    9696
  • trunk/src/tiler.h

    r748 r787  
    3030    static void Deregister(int id);
    3131
    32     static vec2i GetSize(int id);
    3332    static vec2i GetCount(int id);
     33    static vec2i GetSize(int id, int tileid);
    3434    static void Bind(uint32_t code);
    3535    static void BlitTile(uint32_t code, int x, int y, int z, int o,
  • trunk/src/tileset.cpp

    r758 r787  
    160160}
    161161
    162 vec2i TileSet::GetSize() const
     162vec2i TileSet::GetCount() const
     163{
     164    return data->count;
     165}
     166
     167vec2i TileSet::GetSize(int tileid) const
    163168{
    164169    return data->size;
    165 }
    166 
    167 vec2i TileSet::GetCount() const
    168 {
    169     return data->count;
    170170}
    171171
  • trunk/src/tileset.h

    r748 r787  
    4242public:
    4343    /* New methods */
    44     vec2i GetSize() const;
    4544    vec2i GetCount() const;
     45    vec2i GetSize(int tileid) const;
    4646    void Bind();
    4747    void BlitTile(uint32_t id, int x, int y, int z, int o,
Note: See TracChangeset for help on using the changeset viewer.