summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9f3ca6b)
raw | patch | inline | side by side (parent: 9f3ca6b)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Tue, 21 Apr 2020 06:02:43 +0000 (10:02 +0400) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Tue, 21 Apr 2020 06:02:43 +0000 (10:02 +0400) |
src/gl/render.c | patch | blob | history | |
src/render.h | patch | blob | history | |
src/soft/render.c | patch | blob | history | |
src/switch.c | patch | blob | history | |
src/view.c | patch | blob | history | |
src/view.h | patch | blob | history |
diff --git a/src/gl/render.c b/src/gl/render.c
index f68327a051e0572b51c0d0f428e737c330d868ff..28c5b86976ccb1cb97f6cf464698034798d88587 100644 (file)
--- a/src/gl/render.c
+++ b/src/gl/render.c
static int max_wall_height;
static int max_textures;
static image walp[256];
+static byte walswp[256];
static byte walani[256];
static image anip[ANIT][5];
static byte anic[ANIT];
R_gl_free_image(&horiz);
horiz = R_gl_loadimage(s);
}
+
+void R_switch_texture (int x, int y) {
+ assert(x >= 0 && x < FLDW);
+ assert(y >= 0 && y < FLDH);
+ fldb[y][x] = walswp[fldb[y][x]];
+}
+
+int R_get_swp (int n) {
+ assert(n >= 0 && n < 256);
+ return walswp[n];
+}
diff --git a/src/render.h b/src/render.h
index 0b6319c46f367f10ec8297bd5b5cca35d6144773..f9a4cfb91a9d44970efc3c5a2b9ab9a454c2c17c 100644 (file)
--- a/src/render.h
+++ b/src/render.h
void R_set_videomode (int w, int h, int fullscreen);
+void R_switch_texture (int x, int y);
+
void R_get_name (int n, char s[8]);
int R_get_special_id (int n);
+int R_get_swp (int n);
void R_begin_load (void);
void R_load (char s[8], int f);
void R_end_load (void);
diff --git a/src/soft/render.c b/src/soft/render.c
index 38c3ba7f3bc057bcca8db85497cbe1bc5ef06360..e2cb9bf660cc9a4167a33df9168cba13b8b6383b 100644 (file)
--- a/src/soft/render.c
+++ b/src/soft/render.c
static vgaimg *walp[256];
static int walh[256];
static byte walani[256];
+static byte walswp[256];
static int anih[ANIT][5];
static byte anic[ANIT];
static int max_textures;
pitch = 0;
Y_unset_videomode();
}
+
+void R_switch_texture (int x, int y) {
+ assert(x >= 0 && x < FLDW);
+ assert(y >= 0 && y < FLDH);
+ fldb[y][x] = walswp[fldb[y][x]];
+}
+
+int R_get_swp (int n) {
+ assert(n >= 0 && n < 256);
+ return walswp[n];
+}
diff --git a/src/switch.c b/src/switch.c
index 5eebc2d7d5af164406fd0ef6af2784fe194783d8..79f15c02fc38aef8840ca6f2f5658faec2611372 100644 (file)
--- a/src/switch.c
+++ b/src/switch.c
else ++pl2.secrets;
sw[i].tm=1;sw[i].t=0;break;
}
- if(sw[i].tm)
- {fldb[sw[i].y][sw[i].x]=walswp[fldb[sw[i].y][sw[i].x]];p=1;}
+ if (sw[i].tm != 0) {
+ R_switch_texture(sw[i].x, sw[i].y);
+ p = 1;
+ }
if(sw[i].tm==1) sw[i].tm=0;
}
}
diff --git a/src/view.c b/src/view.c
index 08fde9f9e72ea997057401dac8a585d50b1f2b39..043ac7839b459fd6aa0c3c96d5398bf5111f45ba 100644 (file)
--- a/src/view.c
+++ b/src/view.c
int sky_type=1;
dword walf[256];
-byte walswp[256];
byte fldb[FLDH][FLDW];
byte fldf[FLDH][FLDW];
byte fld[FLDH][FLDW];
myfwrite32(walf[i], h);
}
for (i = 0; i < 256; i++) {
- myfwrite8(walswp[i], h);
+ myfwrite8(R_get_swp(i), h);
}
myfwrite(fldb, FLDW*FLDH, 1, h);
myfwrite(fld, FLDW*FLDH, 1, h);
diff --git a/src/view.h b/src/view.h
index 200bf020fde8afe762f4a5f4e061f1ab97c480dd..d64512c66b00b0cbf464fd77f4cccf535f495533 100644 (file)
--- a/src/view.h
+++ b/src/view.h
extern int sky_type;
extern dword walf[256];
-extern byte walswp[256];
extern byte fldb[FLDH][FLDW];
extern byte fldf[FLDH][FLDW];
extern byte fld[FLDH][FLDW];