--- deliantra/Deliantra-Client/Client.xs 2006/08/18 01:27:15 1.142 +++ deliantra/Deliantra-Client/Client.xs 2006/08/18 02:23:39 1.143 @@ -1288,6 +1288,7 @@ cell->face [0] = 0; cell->face [1] = 0; cell->face [2] = 0; + cell->stat_hp = 0; } //TODO: don't trust server data to be in-range(!) @@ -1467,6 +1468,33 @@ glDisable (GL_TEXTURE_2D); glDisable (GL_BLEND); + + for (y = 0; y < sh; y++) + if (0 <= y + vy && y + vy < self->rows) + { + maprow *row = self->row + (y + vy); + + for (x = 0; x < sw; x++) + if (row->c0 <= x + vx && x + vx < row->c1) + { + mapcell *cell = row->col + (x + vx - row->c0); + + int px = x * 32; + int py = y * 32; + + if (cell->stat_hp) + { + glColor3ub (0, 0, 0); + glRectf (px + 1, py + 1, px + 31, py + 4); + + glColor3ub (0, 255, 0); + glBegin (GL_LINES); + glVertex2f (px + 2, py + 2.5f); + glVertex2f (px + 29.f - cell->stat_hp * (28.f / 255.f), py + 2.5f); + glEnd (); + } + } + } } void @@ -1557,7 +1585,7 @@ mapcell *cell = row->col + (x + vx - row->c0); darkness[y * sw4 + x] = cell->darkness - ? 255 - cell->darkness + 1 + ? 255 - (cell->darkness - 1) : 255 - FOW_DARKNESS; } } @@ -1683,7 +1711,7 @@ if (flags & 2) { face[1] = *data++ << 8; face[1] |= *data++; } if (flags & 4) { face[2] = *data++ << 8; face[2] |= *data++; } - if (cell->darkness <= 1) + if (cell->darkness == 0) { cell->darkness = 0;