foxygit / doom Log in
commit 7279f688d1479104fa77a8750973fd7564727d3a
Author:     Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Wed Feb 21 19:55:01 2018 +0100
Commit:     Fabian Greffrath <fabian@greffrath.com>
CommitDate: Wed Feb 21 19:55:01 2018 +0100

    video: more pixel_t type consistency
---
 src/doom/st_stuff.h |  2 +-
 src/v_diskicon.c    | 14 +++++++-------
 src/v_video.c       | 10 +++++-----
 src/v_video.h       |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/doom/st_stuff.h b/src/doom/st_stuff.h
index 8ed53e41..b01a5aed 100644
--- a/src/doom/st_stuff.h
+++ b/src/doom/st_stuff.h
@@ -73,7 +73,7 @@ typedef enum



-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;
diff --git a/src/v_diskicon.c b/src/v_diskicon.c
index 58047ceb..63d2abba 100644
--- a/src/v_diskicon.c
+++ b/src/v_diskicon.c
@@ -35,8 +35,8 @@ static const int diskicon_threshold = 20*1024;
 // 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 int loading_disk_yoffs = 0;
 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 CopyRegion(byte *dest, int dest_pitch,

 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 @@ void V_BeginRead(size_t nbytes)
     recent_bytes_read += nbytes;
 }

-static byte *DiskRegionPointer(void)
+static pixel_t *DiskRegionPointer(void)
 {
     return I_VideoBuffer
          + loading_disk_yoffs * SCREENWIDTH
diff --git a/src/v_video.c b/src/v_video.c
index 55be9964..7c25c889 100644
--- a/src/v_video.c
+++ b/src/v_video.c
@@ -533,7 +533,7 @@ void V_DrawBlock(int x, int y, int width, int height, pixel_t *src)

 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_DrawFilledBox(int x, int y, int w, int h, int c)

 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_DrawHorizLine(int x, int y, int w, int c)

 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 @@ void V_DrawBox(int x, int y, int w, int h, int c)
 // 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));
 }

 //
diff --git a/src/v_video.h b/src/v_video.h
index 9ec9a895..466dcaee 100644
--- a/src/v_video.h
+++ b/src/v_video.h
@@ -75,7 +75,7 @@ void V_DrawBox(int x, int y, int w, int h, int c);

 // 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.