summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fdb3057)
raw | patch | inline | side by side (parent: fdb3057)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 14 Mar 2020 18:43:05 +0000 (21:43 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 14 Mar 2020 18:48:13 +0000 (21:48 +0300) |
src/miscc.c | patch | blob | history | |
src/render.c | patch | blob | history | |
src/view.c | patch | blob | history |
diff --git a/src/miscc.c b/src/miscc.c
index 2ece443937950ae40de63f13a88cc8537a3e5248..90cfecb9d7bb079e6a8d88e60b999358154bfd5b 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, R_get_special_id(wfront));
+ DOT_water(p->x, p->y-p->h / 2, p->xv + p->vx, p->yv + p->vy, n, R_get_special_id(wfront) - 1);
}
void Z_calc_time(dword t,word *h,word *m,word *s)
diff --git a/src/render.c b/src/render.c
index 55ec317d6801ae0baa6dfc8abbb0a507c567af9e..254b87eb6b8e4f907778af90bcd372781adfc4bb 100644 (file)
--- a/src/render.c
+++ b/src/render.c
int sx = x * CELW - w_x + WD / 2;
int sy = y * CELH - w_y + HT / 2 + 1 + w_o;
int id = *p;
- if (id != 0) {
+ if (id) {
+ //intptr_t spc = (intptr_t) walp[id];
int spc = R_get_special_id(id);
- if (spc <= 3) {
+ if (spc >= 0 && spc <= 3) {
if (!bg) {
byte *cmap = clrmap + (spc + 7) * 256;
V_remap_rect(sx, sy, CELW, CELH, cmap);
int R_get_special_id (int n) {
assert(n >= 0 && n < 256);
- intptr_t x = (intptr_t)walp[n] - 1;
- return x > 0 && x <= 3 ? x : 0;
+ intptr_t x = (intptr_t)walp[n];
+ return x >= 0 && x <= 3 ? x : -1;
}
void R_begin_load (void) {
int i;
- for (i = 0; i < max_textures; i++) {
-// if (walp[i] != NULL && walh[i] >= 0) {
-// M_unlock(walp[i]);
-// }
+ for (i = 0; i < 256; i++) {
+ if (walp[i] != NULL && walh[i] >= 0) {
+ M_unlock(walp[i]);
+ }
walh[i] = -1;
walp[i] = NULL;
walswp[i] = i;
walani[i] = 0;
}
memset(anic, 0, sizeof(anic));
- max_textures = 0;
+ max_textures = 1;
}
void R_load (char s[8], int f) {
diff --git a/src/view.c b/src/view.c
index 73953d7dea30d469ec88408bf47f4cd230cc1ff1..4e1fce7858c3cac07379f56376d3d304062d0fe4 100644 (file)
--- a/src/view.c
+++ b/src/view.c
myfread(s[i], 8, 1, h);
}
R_begin_load();
- R_load("", 0); // empty
i = myfread32(h); // ignore
for (i = 1; i < 256; i++) {
walf[i] = myfread32(h);
R_load(s[i], walf[i] & 1);
}
for (i = 0; i < 256; i++) {
- walswp[i] = myfread8(h);
+ //walswp[i] = myfread8(h);
+ (void)myfread8(h); // useless in new code
}
myfread(fldb, FLDW*FLDH, 1, h);
myfread(fld, FLDW*FLDH, 1, h);
switch (blk.t) {
case MB_WALLNAMES:
R_begin_load();
- R_load("", 0); // empty
for (i = 1; i < 256 && blk.sz > 0; i++, blk.sz -= 9) {
myfread(s, 8, 1, h);
t = myfread8(h);