while(i<count) {\r
if(jsoneq(js, &(t[i]), "layers") == 0) {\r
i++;\r
- //map->layerdata = malloc(sizeof(byte*) * t[i].size);\r
+// map->layerdata = malloc(sizeof(byte*) * t[i].size);\r
inner_end = t[i].end;\r
k = 0;\r
while(t[i].start < inner_end) {\r
#ifdef DEBUG_MAPDATA\r
printf("Layer %d data: [\n", k);\r
#endif\r
- map->MAPDATAPTK = malloc(sizeof(byte) * t[i+1].size);\r
+ map->layerdata[k] = malloc(sizeof(byte) * t[i+1].size);\r
//for backwards compatibility for rest of code\r
-// map->data = map->MAPDATAPTK;\r
+ map->data = map->layerdata[k];\r
for(j = 0; j < t[i+1].size; j++) {\r
- map->MAPDATAPTK[j] = (byte)atoi(js + t[i+2+j].start);\r
+ map->layerdata[k][j] = (byte)atoi(js + t[i+2+j].start);\r
#ifdef DEBUG_MAPDATA\r
//printf("[%d,%d]%d", k, j, map->MAPDATAPTK[j]);\r
fprintf(stdout, "%c", map->data[j]+44);\r
typedef struct {\r
//long planestart[3];\r
//unsigned planelength[3];\r
-#ifndef __NEWMAPTILEDATAVARS__\r
byte *data; //TODO: 16_mm and 16_ca must handle this\r
+ byte far *layerdata[MAPLAYERS]; // mapdata for multilayer (map index values for rendering which image on the tile)\r
+#ifndef __NEWMAPTILEDATAVARS__\r
tiles_t *tiles; //TODO: 16_mm and 16_ca must handle this\r
#else\r
- byte far *layerdata[MAPLAYERS]; // mapdata for multilayer (map index values for rendering which image on the tile)\r
tiles_t far *layertile[MAPLAYERS]; // tilesets for layers (currently ony 4 can be loaded wwww)\r
#endif\r
int width, height; //this has to be signed!\r
void modexprint(page_t *page, sword x, sword y, word t, word col, word bgcol, const byte *str)\r
{\r
word s, o, w;\r
- sword x_draw;\r
+ word x_draw;\r
//word addr = (word) romFontsData.l;\r
word addrq;\r
word addrr;\r
\r
x-=page->tlx; y-=page->tly;\r
x_draw = x/4;\r
- addrq = (page->stridew) * y + (x_draw) +\r
+ addrq = (page->stridew) * y + (word)(x_draw) +\r
((word)page->data);\r
addrr = addrq;\r
s=romFonts[t].seg;\r
void near\r
mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y)\r
{\r
- word rx;\r
- word ry;\r
+ word rx, ry;\r
//word textx=0, texty=0;\r
//if(i==0) i=2;\r
switch(i)\r
default:\r
rx = (((i-1) % ((t->pcximg->width)/t->tileWidth)) * t->tileWidth);\r
ry = (((i-1) / ((t->pcximg->height)/t->tileHeight)) * t->tileHeight);\r
-////0000printf("i=%d\n", i);\r
+////0000 printf("i=%d\n", i);\r
#ifndef TILERENDER\r
if(!pagenorendermap) modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, i+1);\r
+ //sprintf(global_temp_status_text2, "%c", i); modexprint(page, x+3, y-1, 1, 1, 2, global_temp_status_text2);\r
#else\r
modexDrawBmpRegion (page, x, y, rx, ry, t->tileWidth, t->tileHeight, i);\r
//draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header),bufsz-sizeof(*vrl_header));\r