shithub: duke3d

Download patch

ref: 585ae62bb0ce786508cb46487fbaba06a7b4d1fb
parent: f284d338db685a9bbb69af4c040b8cd9d88a01d6
author: Fabien Sanglard <fabien.sanglard@gmail.com>
date: Fri Dec 21 01:44:10 EST 2012

Removed useless code in display module.

--- a/Engine/src/display.c
+++ b/Engine/src/display.c
@@ -1661,11 +1661,10 @@
     
 
 
-    if ((debug_hall_of_mirrors) && (qsetmode == 200) && (frameplace))
-    {
+    if ((debug_hall_of_mirrors) && (qsetmode == 200) && (frameplace)){
         memset((void *) frameplace, mirrorcolor, surface->w * surface->h);
         mirrorcolor++;
-    } /* if */
+    }
 
     ticks = getticks();
     total_render_time = (ticks - last_render_ticks);
@@ -1679,57 +1678,15 @@
 } 
 
 
-uint8_t  readpixel(int32_t offset)
+uint8_t  readpixel(uint8_t  * offset)
 {
-    return( *((uint8_t  *) offset) );
-} /* readpixel */
+    return *offset;
+} 
 
 void drawpixel(uint8_t  * location, uint8_t  pixel)
 {
     *location = pixel;
 }
-
-
-/* !!! These are incorrect. */
-void drawpixels(int32_t offset, uint16_t pixels)
-{
-    uint16_t*  surface_end;
-    uint16_t  * pos;
-
-    Error(EXIT_FAILURE, "Blargh!\n");
-
-    if (SDL_MUSTLOCK(surface))
-        SDL_LockSurface(surface);
-
-    surface_end = (uint8_t*)surface->pixels + (surface->w * surface->h) - 2;
-    pos = (uint8_t*)surface->pixels + offset;
-    if ((pos >= (uint16_t*) surface->pixels) && (pos < surface_end))
-        *pos = pixels;
-
-    if (SDL_MUSTLOCK(surface))
-        SDL_UnlockSurface(surface);
-} /* drawpixels */
-
-
-void drawpixelses(int32_t offset, unsigned int pixelses)
-{
-    Uint8 *surface_end;
-    Uint32 *pos;
-
-                Error(EXIT_FAILURE, "Blargh!\n");
-
-    if (SDL_MUSTLOCK(surface))
-        SDL_LockSurface(surface);
-
-    surface_end = (((Uint8 *)surface->pixels) + (surface->w * surface->h)) - 2;
-    pos = (Uint32 *) (((Uint8 *) surface->pixels) + offset);
-    if ((pos >= (Uint32 *) surface->pixels) && (pos < (Uint32 *) surface_end))
-        *pos = pixelses;
-
-    if (SDL_MUSTLOCK(surface))
-        SDL_UnlockSurface(surface);
-} /* drawpixelses */
-
 
 /* Fix this up The Right Way (TM) - DDOI */
 void setcolor16(uint8_t col)
--- a/Engine/src/display.h
+++ b/Engine/src/display.h
@@ -68,10 +68,10 @@
 int setvesa(int32_t x, int32_t y);
 
 void setvmode(int mode);
-uint8_t  readpixel(int32_t offset);
+uint8_t  readpixel(uint8_t  * location);
 void drawpixel(uint8_t  * location, uint8_t pixel);
-void drawpixels(int32_t offset, uint16_t pixels);
-void drawpixelses(int32_t offset, uint32_t pixelses);
+
+
 void drawpixel16(int32_t offset);
 void fillscreen16 (int32_t input1, int32_t input2, int32_t input3);