ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.152 by root, Sat Aug 19 18:18:36 2006 UTC vs.
Revision 1.153 by root, Tue Sep 19 22:02:38 2006 UTC

169 float s, t; 169 float s, t;
170 uint8_t r, g, b, a; 170 uint8_t r, g, b, a;
171} maptex; 171} maptex;
172 172
173typedef struct { 173typedef struct {
174 uint32_t player;
175 mapface face[3];
174 uint16_t darkness; 176 uint16_t darkness;
175 mapface face[3];
176 uint8_t stat_width, stat_hp; 177 uint8_t stat_width, stat_hp, flags;
177} mapcell; 178} mapcell;
178 179
179typedef struct { 180typedef struct {
180 int32_t c0, c1; 181 int32_t c0, c1;
181 mapcell *col; 182 mapcell *col;
1314 cell->stat_width = 1; 1315 cell->stat_width = 1;
1315 cell->stat_hp = *data++; 1316 cell->stat_hp = *data++;
1316 } 1317 }
1317 else if (cmd == 6) // monster width 1318 else if (cmd == 6) // monster width
1318 cell->stat_width = *data++ + 1; 1319 cell->stat_width = *data++ + 1;
1320 else if (cmd == 0x47) // monster width
1321 {
1322 if (*data == 4)
1323 ; // decode player tag
1324
1325 data += *data + 1;
1326 }
1327 else if (cmd == 8) // cell flags
1328 cell->flags = *data++;
1319 else if (ext & 0x40) // unknown, multibyte => skip 1329 else if (ext & 0x40) // unknown, multibyte => skip
1320 data += *data + 1; 1330 data += *data + 1;
1321 else 1331 else
1322 data++; 1332 data++;
1323 } 1333 }
1457 face = cell->face [z]; 1467 face = cell->face [z];
1458 1468
1459 if (face && face < self->texs) 1469 if (face && face < self->texs)
1460 { 1470 {
1461 maptex tex = self->tex [face]; 1471 maptex tex = self->tex [face];
1462
1463 int px = (x + 1) * 32 - tex.w; 1472 int px = (x + 1) * 32 - tex.w;
1464 int py = (y + 1) * 32 - tex.h; 1473 int py = (y + 1) * 32 - tex.h;
1465 1474
1466 if (last_name != tex.name) 1475 if (last_name != tex.name)
1467 { 1476 {
1468 glEnd (); 1477 glEnd ();
1469 last_name = tex.name;
1470 glBindTexture (GL_TEXTURE_2D, last_name); 1478 glBindTexture (GL_TEXTURE_2D, last_name = tex.name);
1471 glBegin (GL_QUADS); 1479 glBegin (GL_QUADS);
1472 } 1480 }
1473 1481
1474 glTexCoord2f (0 , 0 ); glVertex2f (px , py ); 1482 glTexCoord2f (0 , 0 ); glVertex2f (px , py );
1475 glTexCoord2f (0 , tex.t); glVertex2f (px , py + tex.h); 1483 glTexCoord2f (0 , tex.t); glVertex2f (px , py + tex.h);
1476 glTexCoord2f (tex.s, tex.t); glVertex2f (px + tex.w, py + tex.h); 1484 glTexCoord2f (tex.s, tex.t); glVertex2f (px + tex.w, py + tex.h);
1477 glTexCoord2f (tex.s, 0 ); glVertex2f (px + tex.w, py ); 1485 glTexCoord2f (tex.s, 0 ); glVertex2f (px + tex.w, py );
1486 }
1487
1488 if (cell->flags && z == 2)
1489 {
1490 if (cell->flags & 1)
1491 {
1492 maptex tex = self->tex [1];
1493 int px = (x + 1) * 32 - tex.w + 2;
1494 int py = (y + 1) * 32 - tex.h - 6;
1495
1496 glEnd ();
1497 glBindTexture (GL_TEXTURE_2D, last_name = tex.name);
1498 glBegin (GL_QUADS);
1499
1500 glTexCoord2f (0 , 0 ); glVertex2f (px , py );
1501 glTexCoord2f (0 , tex.t); glVertex2f (px , py + tex.h);
1502 glTexCoord2f (tex.s, tex.t); glVertex2f (px + tex.w, py + tex.h);
1503 glTexCoord2f (tex.s, 0 ); glVertex2f (px + tex.w, py );
1504 }
1478 } 1505 }
1479 } 1506 }
1480 } 1507 }
1481 1508
1482 glEnd (); 1509 glEnd ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines