ref: 76563314d19e01997f1a03bf81c14ccdf6d86300
parent: 9d7854adca6f7c7bd9f83173e3ac4b0842b2aca1
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Fri Dec 22 17:31:16 EST 2023
no more fbpal
--- a/unix/vid.c
+++ b/unix/vid.c
@@ -3,6 +3,8 @@
int resized;
+pixel_t q1pal[256];
+
static SDL_Renderer *rend;
static SDL_Texture *fbi;
static SDL_Window *win;
@@ -9,9 +11,6 @@
static pixel_t *vidbuffer;
extern pixel_t *r_warpbuffer;
-s32int fbpal[256];
-pixel_t q1pal[256];
-
static void
resetfb(void)
{
@@ -97,11 +96,8 @@
void
setpal(uchar *p0)
{
- int *fp, x;
+ int x;
uchar *p;
-
- for(p = p0, fp=fbpal; fp<fbpal+nelem(fbpal); p+=3, fp++)
- *fp = 0xff<<24 | p[0] << 16 | p[1] << 8 | p[2];
for(p = p0, x = 0; x < 256; x++, p += 3)
q1pal[x] = (x < 256-32 ? 0xff : 0)<<24 | p[0]<<16 | p[1]<<8 | p[2];
--- a/vid.c
+++ b/vid.c
@@ -7,7 +7,6 @@
Point center; /* of window */
Rectangle grabr;
-s32int fbpal[256];
pixel_t q1pal[256];
static Image *fbi;
static Rectangle fbr;
@@ -131,11 +130,8 @@
void
setpal(uchar *p0)
{
- int *fp, x;
+ int x;
uchar *p;
-
- for(p = p0, fp=fbpal; fp<fbpal+nelem(fbpal); p+=3, fp++)
- *fp = p[0] << 16 | p[1] << 8 | p[2];
for(p = p0, x = 0; x < 256; x++, p += 3)
q1pal[x] = (x < 256-32 ? 0xff : 0)<<24 | p[0]<<16 | p[1]<<8 | p[2];