unnecessary memcpy removed

This commit is contained in:
ozkl 2020-05-16 17:56:17 +03:00
parent a381494150
commit 58fa1d7bba

View File

@ -89,7 +89,6 @@ void I_GetEvent(void);
// The screen buffer; this is modified to draw things to the screen // The screen buffer; this is modified to draw things to the screen
byte *I_VideoBuffer = NULL; byte *I_VideoBuffer = NULL;
byte *I_VideoBuffer_FB = NULL;
// If true, game is running as a screensaver // If true, game is running as a screensaver
@ -221,7 +220,6 @@ void I_InitGraphics (void)
/* Allocate screen to draw to */ /* Allocate screen to draw to */
I_VideoBuffer = (byte*)Z_Malloc (SCREENWIDTH * SCREENHEIGHT, PU_STATIC, NULL); // For DOOM to draw on I_VideoBuffer = (byte*)Z_Malloc (SCREENWIDTH * SCREENHEIGHT, PU_STATIC, NULL); // For DOOM to draw on
I_VideoBuffer_FB = (byte*)malloc(s_Fb.xres * s_Fb.yres * (s_Fb.bits_per_pixel/8)); // For a single write() syscall to fbdev
screenvisible = true; screenvisible = true;
@ -232,7 +230,6 @@ void I_InitGraphics (void)
void I_ShutdownGraphics (void) void I_ShutdownGraphics (void)
{ {
Z_Free (I_VideoBuffer); Z_Free (I_VideoBuffer);
free(I_VideoBuffer_FB);
} }
void I_StartFrame (void) void I_StartFrame (void)
@ -270,7 +267,7 @@ void I_FinishUpdate (void)
/* DRAW SCREEN */ /* DRAW SCREEN */
line_in = (unsigned char *) I_VideoBuffer; line_in = (unsigned char *) I_VideoBuffer;
line_out = (unsigned char *) I_VideoBuffer_FB; line_out = (unsigned char *) DG_ScreenBuffer;
y = SCREENHEIGHT; y = SCREENHEIGHT;
@ -294,8 +291,6 @@ void I_FinishUpdate (void)
line_in += SCREENWIDTH; line_in += SCREENWIDTH;
} }
memcpy(DG_ScreenBuffer, I_VideoBuffer_FB, (SCREENHEIGHT * fb_scaling * (s_Fb.bits_per_pixel / 8)) * s_Fb.xres);
DG_DrawFrame(); DG_DrawFrame();
} }