source: trunk/src/layer.cpp @ 74

Last change on this file since 74 was 74, checked in by sam, 11 years ago

Support CSV .tmx files to get rid of that pathetic system() call.

  • Property svn:keywords set to Id
File size: 558 bytes
Line 
1
2#include "layer.h"
3
4Layer::Layer(int w, int h, int in_z, uint32_t *in_data)
5{
6    width = w;
7    height = h;
8    z = in_z;
9    data = in_data;
10
11#if 0
12    fread(data, sizeof(unsigned int), width * height, fp);
13    for (int n = 0; n < width * height; n++)
14    {
15        unsigned int i = data[n];
16        // XXX: endianness swapping might be necessary here
17        data[n] = i ? i - 1 : 0;
18    }
19#endif
20}
21
22Layer::~Layer()
23{
24    delete data;
25}
26
27int Layer::GetZ()
28{
29    return z;
30}
31
32unsigned int Layer::GetTile(int x, int y)
33{
34    return data[y * width + x];
35}
36
Note: See TracBrowser for help on using the repository browser.