Ignore:
Timestamp:
Feb 12, 2011, 12:01:20 AM (10 years ago)
Author:
sam
Message:

Allow to query for a tileset's size and/or number of tiles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tiler.cpp

    r633 r637  
    6868}
    6969
     70int2 Tiler::GetSize(int id)
     71{
     72    TileSet *tileset = (TileSet *)data->tilesets.GetEntity(id - 1);
     73#if !FINAL_RELEASE
     74    if (!tileset)
     75    {
     76        fprintf(stderr, "ERROR: getting size for null tiler #%i\n", id);
     77        return 0;
     78    }
     79#endif
     80    return tileset->GetSize();
     81}
     82
     83int2 Tiler::GetCount(int id)
     84{
     85    TileSet *tileset = (TileSet *)data->tilesets.GetEntity(id - 1);
     86#if !FINAL_RELEASE
     87    if (!tileset)
     88    {
     89        fprintf(stderr, "ERROR: getting count for null tiler #%i\n", id);
     90        return 0;
     91    }
     92#endif
     93    return tileset->GetCount();
     94}
     95
    7096void Tiler::BlitTile(uint32_t code, int x, int y, int z, int o)
    7197{
Note: See TracChangeset for help on using the changeset viewer.