Changeset 186 for trunk/src/map.cpp


Ignore:
Timestamp:
Aug 29, 2010, 12:51:13 AM (11 years ago)
Author:
sam
Message:

Support tilesets larger than 512x512 and switch the coordinates system to
(0,0) at the bottom left.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/map.cpp

    r150 r186  
    9191                }
    9292
    93                 tiles[ntiles++] = code;
     93                int x = ntiles % data->width;
     94                int y = data->height - 1 - (ntiles / data->width);
     95                tiles[y * data->width + x] = code;
     96                ntiles++;
     97
    9498                while (isdigit(*parser))
    9599                    parser++;
Note: See TracChangeset for help on using the changeset viewer.