summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 647924a)
raw | patch | inline | side by side (parent: 647924a)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 2 Apr 2020 06:14:10 +0000 (10:14 +0400) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 2 Apr 2020 06:14:10 +0000 (10:14 +0400) |
src/soft/render.c | patch | blob | history | |
src/soft/vga.c | patch | blob | history | |
src/soft/vga.h | patch | blob | history |
diff --git a/src/soft/render.c b/src/soft/render.c
index 74a3c0f898f2a776467ecd3c134161d82fca6e1f..bda872709396df868677befde09a226678e5b2b4 100644 (file)
--- a/src/soft/render.c
+++ b/src/soft/render.c
}
} else {
Y_get_videomode(&SCRW, &SCRH);
- Y_get_buffer(&buffer, &buf_w, &buf_h, &pitch);
+ V_update_buffer();
R_setgamma(gammaa);
}
}
Y_set_fullscreen(!Y_get_fullscreen());
fullscreen = Y_get_fullscreen();
Y_get_videomode(&SCRW, &SCRH);
- Y_get_buffer(&buffer, &buf_w, &buf_h, &pitch);
+ V_update_buffer();
R_setgamma(gammaa);
}
diff --git a/src/soft/vga.c b/src/soft/vga.c
index ce83101ec24dbabf5d61fad05295fb9915ca5705..a747a31495e8547818539bcfca7cb35d46d3c23f 100644 (file)
--- a/src/soft/vga.c
+++ b/src/soft/vga.c
return V_getvgaimg(F_getresid(name));
}
+void V_update_buffer (void) {
+ Y_get_buffer(&buffer, &buf_w, &buf_h, &pitch);
+ V_setrect(0, 0, buf_w, buf_h);
+}
+
static void draw_rect (int x, int y, int w, int h, int c) {
int i;
int x0 = max(x, cx1);
}
void V_setrect (short x, short w, short y, short h) {
+ assert(w >= 0);
+ assert(h >= 0);
cx1 = max(x, 0);
cx2 = min(x + w - 1, buf_w - 1);
cy1 = max(y, 0);
diff --git a/src/soft/vga.h b/src/soft/vga.h
index dc91d2b90d343fae503973b9e89c58660ec62719..eb077023c347b9a392ce7ddc9af35fb26c581308 100644 (file)
--- a/src/soft/vga.h
+++ b/src/soft/vga.h
void V_remap_rect (int x, int y, int w, int h, byte *cmap);
+void V_update_buffer (void);
void V_rotspr (int x, int y, vgaimg* i, int d);
void V_center (int f);
void V_offset (int ox, int oy);