ref: 7279f688d1479104fa77a8750973fd7564727d3a
parent: 28b514bb0e54250e69585b544a6c78a556f6ba0f
author: Fabian Greffrath <fabian@greffrath.com>
date: Wed Feb 21 14:55:01 EST 2018
video: more pixel_t type consistency
--- a/src/doom/st_stuff.h
+++ b/src/doom/st_stuff.h
@@ -73,7 +73,7 @@
-extern byte *st_backing_screen;
+extern pixel_t *st_backing_screen;
extern cheatseq_t cheat_mus;
extern cheatseq_t cheat_god;
extern cheatseq_t cheat_ammo;
--- a/src/v_diskicon.c
+++ b/src/v_diskicon.c
@@ -35,8 +35,8 @@
// Two buffers: disk_data contains the data representing the disk icon
// (raw, not a patch_t) while saved_background is an equivalently-sized
// buffer where we save the background data while the disk is on screen.
-static byte *disk_data;
-static byte *saved_background;
+static pixel_t *disk_data;
+static pixel_t *saved_background;
static int loading_disk_xoffs = 0;
static int loading_disk_yoffs = 0;
@@ -45,11 +45,11 @@
static size_t recent_bytes_read = 0;
static boolean disk_drawn;
-static void CopyRegion(byte *dest, int dest_pitch,
- byte *src, int src_pitch,
+static void CopyRegion(pixel_t *dest, int dest_pitch,
+ pixel_t *src, int src_pitch,
int w, int h)
{
- byte *s, *d;
+ pixel_t *s, *d;
int y;
s = src; d = dest;
@@ -63,7 +63,7 @@
static void SaveDiskData(char *disk_lump, int xoffs, int yoffs)
{
- byte *tmpscreen;
+ pixel_t *tmpscreen;
patch_t *disk;
// Allocate a complete temporary screen where we'll draw the patch.
@@ -104,7 +104,7 @@
recent_bytes_read += nbytes;
}
-static byte *DiskRegionPointer(void)
+static pixel_t *DiskRegionPointer(void)
{
return I_VideoBuffer
+ loading_disk_yoffs * SCREENWIDTH
--- a/src/v_video.c
+++ b/src/v_video.c
@@ -533,7 +533,7 @@
void V_DrawFilledBox(int x, int y, int w, int h, int c)
{
- uint8_t *buf, *buf1;
+ pixel_t *buf, *buf1;
int x1, y1;
buf = I_VideoBuffer + SCREENWIDTH * y + x;
@@ -553,7 +553,7 @@
void V_DrawHorizLine(int x, int y, int w, int c)
{
- uint8_t *buf;
+ pixel_t *buf;
int x1;
buf = I_VideoBuffer + SCREENWIDTH * y + x;
@@ -566,7 +566,7 @@
void V_DrawVertLine(int x, int y, int h, int c)
{
- uint8_t *buf;
+ pixel_t *buf;
int y1;
buf = I_VideoBuffer + SCREENWIDTH * y + x;
@@ -591,9 +591,9 @@
// to the screen)
//
-void V_DrawRawScreen(byte *raw)
+void V_DrawRawScreen(pixel_t *raw)
{
- memcpy(dest_screen, raw, SCREENWIDTH * SCREENHEIGHT);
+ memcpy(dest_screen, raw, SCREENWIDTH * SCREENHEIGHT * sizeof(*dest_screen));
}
//
--- a/src/v_video.h
+++ b/src/v_video.h
@@ -75,7 +75,7 @@
// Draw a raw screen lump
-void V_DrawRawScreen(byte *raw);
+void V_DrawRawScreen(pixel_t *raw);
// Temporarily switch to using a different buffer to draw graphics, etc.