Changeset 790 for trunk/src/map.cpp


Ignore:
Timestamp:
Jul 23, 2011, 11:14:40 PM (10 years ago)
Author:
sam
Message:

tileset: replace the Tiler ID system with real TileSet objects. The only
thing that is still broken is the Layer <--> Map interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/map.cpp

    r758 r790  
    3434    friend class Map;
    3535
    36     static int const MAX_TILERS = 128;
     36    static int const MAX_TILESETS = 128;
    3737
    3838private:
    39     int tilers[MAX_TILERS];
     39    TileSet *tilesets[MAX_TILESETS];
    4040    int ntilers;
    4141
     
    6060
    6161    char tmp[BUFSIZ];
    62     int gids[MapData::MAX_TILERS];
     62    int gids[MapData::MAX_TILESETS];
    6363    uint32_t *tiles = NULL;
    6464    int level = 0, orientation = 0, ntiles = 0;
     
    9696                             || id < gids[n + 1])
    9797                        {
    98                             code = (data->tilers[n] << 16) | (id - gids[n]);
     98                            Log::Error("tilesets no longer work this way");
     99                            //code = (data->tilesets[n] << 16) | (id - gids[n]);
    99100                            break;
    100101                        }
     
    133134        {
    134135            /* This is a tileset image file. Associate it with firstgid. */
    135             data->tilers[data->ntilers] = Tiler::Register(str, 32, 0,
     136            data->tilesets[data->ntilers] = Tiler::Register(str, 32, 0,
    136137                                                          sqrtf(2));
    137138            data->ntilers++;
     
    159160{
    160161    for (int i = 0; i < data->ntilers; i++)
    161         Tiler::Deregister(data->tilers[i]);
     162        Tiler::Deregister(data->tilesets[i]);
    162163    for (int i = 0; i < data->nlayers; i++)
    163164        delete data->layers[i];
Note: See TracChangeset for help on using the changeset viewer.