Skip to content

Commit 58fa1d7

Browse files
committed
unnecessary memcpy removed
1 parent a381494 commit 58fa1d7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

doomgeneric/i_video.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ void I_GetEvent(void);
8989
// The screen buffer; this is modified to draw things to the screen
9090

9191
byte *I_VideoBuffer = NULL;
92-
byte *I_VideoBuffer_FB = NULL;
9392

9493
// If true, game is running as a screensaver
9594

@@ -221,7 +220,6 @@ void I_InitGraphics (void)
221220

222221
/* Allocate screen to draw to */
223222
I_VideoBuffer = (byte*)Z_Malloc (SCREENWIDTH * SCREENHEIGHT, PU_STATIC, NULL); // For DOOM to draw on
224-
I_VideoBuffer_FB = (byte*)malloc(s_Fb.xres * s_Fb.yres * (s_Fb.bits_per_pixel/8)); // For a single write() syscall to fbdev
225223

226224
screenvisible = true;
227225

@@ -232,7 +230,6 @@ void I_InitGraphics (void)
232230
void I_ShutdownGraphics (void)
233231
{
234232
Z_Free (I_VideoBuffer);
235-
free(I_VideoBuffer_FB);
236233
}
237234

238235
void I_StartFrame (void)
@@ -270,7 +267,7 @@ void I_FinishUpdate (void)
270267

271268
/* DRAW SCREEN */
272269
line_in = (unsigned char *) I_VideoBuffer;
273-
line_out = (unsigned char *) I_VideoBuffer_FB;
270+
line_out = (unsigned char *) DG_ScreenBuffer;
274271

275272
y = SCREENHEIGHT;
276273

@@ -294,8 +291,6 @@ void I_FinishUpdate (void)
294291
line_in += SCREENWIDTH;
295292
}
296293

297-
memcpy(DG_ScreenBuffer, I_VideoBuffer_FB, (SCREENHEIGHT * fb_scaling * (s_Fb.bits_per_pixel / 8)) * s_Fb.xres);
298-
299294
DG_DrawFrame();
300295
}
301296

0 commit comments

Comments
 (0)