void Z_splash(obj_t *p,int n) {
Z_sound(bulsnd[0],128);
DOT_water(p->x,p->y-p->h/2,p->xv+p->vx,p->yv+p->vy,n,
- (int)walp[wfront]-1);
+ (intptr_t)walp[wfront]-1);
}
void Z_calc_time(dword t,word *h,word *m,word *s)
#else
return x;
#endif
-}
\ No newline at end of file
+}
extern void *walp[256];
extern byte clrmap[256*12];
-void Z_drawfld(byte *fld, int bg)
+void Z_drawfld (byte *fld, int bg)
{
byte *p = fld;
- int x,y;
- for (y=0; y<FLDH; y++)
- {
- for (x=0; x<FLDW; x++)
- {
- int sx = x*CELW-w_x+WD/2;
- int sy = y*CELH-w_y+HT/2+1+w_o;
-
-
+ int x, y;
+ for (y = 0; y < FLDH; y++) {
+ for (x = 0; x < FLDW; x++) {
+ int sx = x * CELW - w_x + WD / 2;
+ int sy = y * CELH - w_y + HT / 2 + 1 + w_o;
if (*p) {
- vgaimg *pic = walp[*p];
- if ((int)pic <= 3) {
- if (!bg) {
- byte *cmap = clrmap + ((int)pic+7)*256;
- V_remap_rect(sx, sy, CELW, CELH, cmap);
- }
- }
- else {
- V_pic(sx, sy, pic);
+ vgaimg *pic = walp[*p];
+ // special pointer value setted for _WATER_* in view.c
+ if ((intptr_t)pic <= 3) {
+ if (!bg) {
+ byte *cmap = clrmap + ((intptr_t)pic+7)*256;
+ V_remap_rect(sx, sy, CELW, CELH, cmap);
}
+ } else {
+ V_pic(sx, sy, pic);
+ }
}
-
p++;
}
}
memset(s, 0, 8);
} else if (walh[n] == -2) {
memcpy(s, "_WATER_", 8);
- s[7] = (char)walp[n] - 1 + '0';
+ s[7] = (char)((intptr_t)walp[n] - 1 + '0');
} else {
F_getresname(s, walh[n] & 0x7FFF);
}
walani[i] = getani(s);
if (strncasecmp(s, "_WATER_", 7) == 0) {
walh[i] = -2;
- walp[i] = (void*)(s[7] - '0' + 1);
+ walp[i] = (void*)((intptr_t)s[7] - '0' + 1);
} else {
walh[i] = F_getresid(s);
walp[i] = V_getvgaimg(walh[i]);
myfread(w.n, 8, 1, h);
w.t = myfread8(h);
if (strncasecmp(w.n, "_WATER_", 7) == 0) {
- walp[i] = (void*)(w.n[7] - '0' + 1);
+ walp[i] = (void*)((intptr_t)w.n[7] - '0' + 1);
walh[i] = -2;
} else {
walh[i] = F_getresid(w.n);