--- deliantra/Deliantra-Client/Client.xs 2006/08/19 18:18:36 1.152 +++ deliantra/Deliantra-Client/Client.xs 2006/09/19 22:02:38 1.153 @@ -171,9 +171,10 @@ } maptex; typedef struct { - uint16_t darkness; + uint32_t player; mapface face[3]; - uint8_t stat_width, stat_hp; + uint16_t darkness; + uint8_t stat_width, stat_hp, flags; } mapcell; typedef struct { @@ -1316,6 +1317,15 @@ } else if (cmd == 6) // monster width cell->stat_width = *data++ + 1; + else if (cmd == 0x47) // monster width + { + if (*data == 4) + ; // decode player tag + + data += *data + 1; + } + else if (cmd == 8) // cell flags + cell->flags = *data++; else if (ext & 0x40) // unknown, multibyte => skip data += *data + 1; else @@ -1459,15 +1469,13 @@ if (face && face < self->texs) { maptex tex = self->tex [face]; - int px = (x + 1) * 32 - tex.w; int py = (y + 1) * 32 - tex.h; if (last_name != tex.name) { glEnd (); - last_name = tex.name; - glBindTexture (GL_TEXTURE_2D, last_name); + glBindTexture (GL_TEXTURE_2D, last_name = tex.name); glBegin (GL_QUADS); } @@ -1476,6 +1484,25 @@ glTexCoord2f (tex.s, tex.t); glVertex2f (px + tex.w, py + tex.h); glTexCoord2f (tex.s, 0 ); glVertex2f (px + tex.w, py ); } + + if (cell->flags && z == 2) + { + if (cell->flags & 1) + { + maptex tex = self->tex [1]; + int px = (x + 1) * 32 - tex.w + 2; + int py = (y + 1) * 32 - tex.h - 6; + + glEnd (); + glBindTexture (GL_TEXTURE_2D, last_name = tex.name); + glBegin (GL_QUADS); + + glTexCoord2f (0 , 0 ); glVertex2f (px , py ); + glTexCoord2f (0 , tex.t); glVertex2f (px , py + tex.h); + glTexCoord2f (tex.s, tex.t); glVertex2f (px + tex.w, py + tex.h); + glTexCoord2f (tex.s, 0 ); glVertex2f (px + tex.w, py ); + } + } } }