summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2a4083d)
raw | patch | inline | side by side (parent: 2a4083d)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 11 Mar 2020 21:30:03 +0000 (00:30 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 11 Mar 2020 21:30:03 +0000 (00:30 +0300) |
src/miscc.c | patch | blob | history | |
src/vga.c | patch | blob | history | |
src/view.c | patch | blob | history |
diff --git a/src/miscc.c b/src/miscc.c
index b7058172d4dd025e4af6de4efbbb1ee0949c3a71..3479689db3e6481c86bb0469a6748147162b019e 100644 (file)
--- a/src/miscc.c
+++ b/src/miscc.c
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
+}
diff --git a/src/vga.c b/src/vga.c
index f2e5b44079941a7db71016564543efc4f664f44c..3b4e06516a2794a295fba2e6f9fe641782123d29 100644 (file)
--- a/src/vga.c
+++ b/src/vga.c
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++;
}
}
diff --git a/src/view.c b/src/view.c
index 51e8179a1279b0e940909327a1de068e1f99b403..692066edf0db64efff3ea90caebb199209f5731f 100644 (file)
--- a/src/view.c
+++ b/src/view.c
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);