summaryrefslogtreecommitdiff
path: root/apps/plugins/doom/v_video.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/doom/v_video.c')
-rw-r--r--apps/plugins/doom/v_video.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/apps/plugins/doom/v_video.c b/apps/plugins/doom/v_video.c
index 75ccc3ffda..ca90c4b293 100644
--- a/apps/plugins/doom/v_video.c
+++ b/apps/plugins/doom/v_video.c
@@ -44,7 +44,7 @@
44#include "m_swap.h" 44#include "m_swap.h"
45#include "rockmacros.h" 45#include "rockmacros.h"
46// Each screen is [SCREENWIDTH*SCREENHEIGHT]; 46// Each screen is [SCREENWIDTH*SCREENHEIGHT];
47byte *screens[6] IBSS_ATTR; 47byte *d_screens[6] IBSS_ATTR;
48int dirtybox[4]; 48int dirtybox[4];
49 49
50/* jff 4/24/98 initialize this at runtime */ 50/* jff 4/24/98 initialize this at runtime */
@@ -239,8 +239,8 @@ void V_CopyRect(int srcx, int srcy, int srcscrn, int width,
239 239
240 V_MarkRect (destx, desty, width, height); 240 V_MarkRect (destx, desty, width, height);
241 241
242 src = screens[srcscrn]+SCREENWIDTH*srcy+srcx; 242 src = d_screens[srcscrn]+SCREENWIDTH*srcy+srcx;
243 dest = screens[destscrn]+SCREENWIDTH*desty+destx; 243 dest = d_screens[destscrn]+SCREENWIDTH*desty+destx;
244 244
245 for ( ; height>0 ; height--) 245 for ( ; height>0 ; height--)
246 { 246 {
@@ -294,7 +294,7 @@ void V_DrawBlock(int x, int y, int scrn, int width, int height,
294 if (!scrn) 294 if (!scrn)
295 V_MarkRect (x, y, width, height); 295 V_MarkRect (x, y, width, height);
296 296
297 dest = screens[scrn] + y*SCREENWIDTH+x; 297 dest = d_screens[scrn] + y*SCREENWIDTH+x;
298 // x & y no longer needed 298 // x & y no longer needed
299 299
300 while (height--) { 300 while (height--) {
@@ -308,7 +308,7 @@ void V_DrawBlock(int x, int y, int scrn, int width, int height,
308 } else { 308 } else {
309 V_MarkRect (x, y, width, height); 309 V_MarkRect (x, y, width, height);
310 310
311 dest = screens[scrn] + y*SCREENWIDTH+x; 311 dest = d_screens[scrn] + y*SCREENWIDTH+x;
312 312
313 while (height--) { 313 while (height--) {
314 memcpy (dest, src, width); 314 memcpy (dest, src, width);
@@ -369,7 +369,7 @@ void V_GetBlock(int x, int y, int scrn, int width, int height, byte *dest)
369 I_Error ("V_GetBlock: Bad arguments"); 369 I_Error ("V_GetBlock: Bad arguments");
370#endif 370#endif
371 371
372 src = screens[scrn] + y*SCREENWIDTH+x; 372 src = d_screens[scrn] + y*SCREENWIDTH+x;
373 373
374 while (height--) 374 while (height--)
375 { 375 {
@@ -394,13 +394,13 @@ void V_Init (void)
394#define PREALLOCED_SCREENS 2 394#define PREALLOCED_SCREENS 2
395 395
396 // CPhipps - no point in "stick these in low dos memory on PCs" anymore 396 // CPhipps - no point in "stick these in low dos memory on PCs" anymore
397 // Allocate the screens individually, so I_InitGraphics can release screens[0] 397 // Allocate the screens individually, so I_InitGraphics can release d_screens[0]
398 // if e.g. it wants a MitSHM buffer instead 398 // if e.g. it wants a MitSHM buffer instead
399 399
400 for (i=0 ; i<PREALLOCED_SCREENS ; i++) 400 for (i=0 ; i<PREALLOCED_SCREENS ; i++)
401 screens[i] = calloc(SCREENWIDTH*SCREENHEIGHT, 1); 401 d_screens[i] = calloc(SCREENWIDTH*SCREENHEIGHT, 1);
402 for (; i<4; i++) // Clear the rest (paranoia) 402 for (; i<4; i++) // Clear the rest (paranoia)
403 screens[i] = NULL; 403 d_screens[i] = NULL;
404} 404}
405 405
406// 406//
@@ -448,7 +448,7 @@ void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch,
448 if (!(flags & VPT_STRETCH)) { 448 if (!(flags & VPT_STRETCH)) {
449 unsigned int col; 449 unsigned int col;
450 const column_t *column; 450 const column_t *column;
451 byte *desttop = screens[scrn]+y*SCREENWIDTH+x; 451 byte *desttop = d_screens[scrn]+y*SCREENWIDTH+x;
452 unsigned int w = SHORT(patch->width); 452 unsigned int w = SHORT(patch->width);
453 453
454 if (!scrn) 454 if (!scrn)
@@ -544,7 +544,7 @@ void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch,
544 V_MarkRect ( stretchx, stretchy, (SHORT( patch->width ) * DX ) >> 16, 544 V_MarkRect ( stretchx, stretchy, (SHORT( patch->width ) * DX ) >> 16,
545 (SHORT( patch->height) * DY ) >> 16 ); 545 (SHORT( patch->height) * DY ) >> 16 );
546 546
547 desttop = screens[scrn] + stretchy * SCREENWIDTH + stretchx; 547 desttop = d_screens[scrn] + stretchy * SCREENWIDTH + stretchx;
548 548
549 for ( col = 0; col <= w; x++, col+=DXI, desttop++ ) { 549 for ( col = 0; col <= w; x++, col+=DXI, desttop++ ) {
550 const column_t *column; 550 const column_t *column;
@@ -640,11 +640,11 @@ byte *V_PatchToBlock(const char* name, int cm,
640 enum patch_translation_e flags, 640 enum patch_translation_e flags,
641 unsigned short* width, unsigned short* height) 641 unsigned short* width, unsigned short* height)
642{ 642{
643 byte *oldscr = screens[1]; 643 byte *oldscr = d_screens[1];
644 byte *block; 644 byte *block;
645 const patch_t *patch; 645 const patch_t *patch;
646 646
647 screens[1] = calloc(SCREENWIDTH*SCREENHEIGHT, 1); 647 d_screens[1] = calloc(SCREENWIDTH*SCREENHEIGHT, 1);
648 648
649 patch = W_CacheLumpName(name); 649 patch = W_CacheLumpName(name);
650 V_DrawMemPatch(SHORT(patch->leftoffset), SHORT(patch->topoffset), 650 V_DrawMemPatch(SHORT(patch->leftoffset), SHORT(patch->topoffset),
@@ -662,8 +662,8 @@ byte *V_PatchToBlock(const char* name, int cm,
662 V_GetBlock(0, 0, 1, *width, *height, 662 V_GetBlock(0, 0, 1, *width, *height,
663 block = malloc((long)(*width) * (*height))); 663 block = malloc((long)(*width) * (*height)));
664 664
665 free(screens[1]); 665 free(d_screens[1]);
666 screens[1] = oldscr; 666 d_screens[1] = oldscr;
667 return block; 667 return block;
668} 668}
669#endif /* GL_DOOM */ 669#endif /* GL_DOOM */
@@ -691,7 +691,7 @@ void V_SetPalette(int pal)
691#ifndef GL_DOOM 691#ifndef GL_DOOM
692void V_FillRect(int scrn, int x, int y, int width, int height, byte colour) 692void V_FillRect(int scrn, int x, int y, int width, int height, byte colour)
693{ 693{
694 byte* dest = screens[scrn] + x + y*SCREENWIDTH; 694 byte* dest = d_screens[scrn] + x + y*SCREENWIDTH;
695 while (height--) { 695 while (height--) {
696 memset(dest, colour, width); 696 memset(dest, colour, width);
697 dest += SCREENWIDTH; 697 dest += SCREENWIDTH;