Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 82608
Collapse All | Expand All

(-)rott-1.0/rott/modexlib.c (-3 / +98 lines)
Lines 39-44 Link Here
39
#include "memcheck.h"
39
#include "memcheck.h"
40
#include "rt_util.h"
40
#include "rt_util.h"
41
41
42
#define FULLSCREENHACK   // !New!
42
43
43
// GLOBAL VARIABLES
44
// GLOBAL VARIABLES
44
45
Lines 407-413 Link Here
407
====================
408
====================
408
*/
409
*/
409
static SDL_Surface *sdl_surface = NULL;
410
static SDL_Surface *sdl_surface = NULL;
410
static SDL_Surface *sdl_backbuf = NULL;
411
#ifdef FULLSCREENHACK    // [!New!
412
static byte *backbuf = NULL; // Game drawing will happen here
413
#endif                   // !New!]
411
414
412
void GraphicsMode ( void )
415
void GraphicsMode ( void )
413
{
416
{
Lines 426-432 Link Here
426
429
427
    SDL_WM_SetCaption ("Rise of the Triad", "ROTT");
430
    SDL_WM_SetCaption ("Rise of the Triad", "ROTT");
428
    SDL_ShowCursor (0);
431
    SDL_ShowCursor (0);
429
    sdl_surface = SDL_SetVideoMode (320, 200, 8, flags);
432
#ifdef FULLSCREENHACK    // [!New!
433
    sdl_surface = SDL_SetVideoMode (640, 480, 8, flags);
434
	backbuf = SafeMalloc(320*200);
435
#else                    // !New!]
436
	sdl_surface = SDL_SetVideoMode (320, 200, 8, flags);
437
#endif
430
    
438
    
431
	if (sdl_surface == NULL)
439
	if (sdl_surface == NULL)
432
	{
440
	{
Lines 452-457 Link Here
452
		
460
		
453
		SDL_QuitSubSystem (SDL_INIT_VIDEO);
461
		SDL_QuitSubSystem (SDL_INIT_VIDEO);
454
	}
462
	}
463
#ifdef FULLSCREENHACK    // [!New!
464
	if(backbuf != NULL) {
465
		SafeFree(backbuf);
466
		backbuf = NULL;
467
	}
468
#endif                   // !New!]
455
}
469
}
456
470
457
/*
471
/*
Lines 506-514 Link Here
506
520
507
    screensize=MAXSCREENHEIGHT*MAXSCREENWIDTH;
521
    screensize=MAXSCREENHEIGHT*MAXSCREENWIDTH;
508
522
523
#ifdef FULLSCREENHACK    // [!New!
524
    page1start=(int)backbuf;
525
    page2start=(int)backbuf;
526
    page3start=(int)backbuf;
527
#else                    // !New!]
509
    page1start=(int)sdl_surface->pixels;
528
    page1start=(int)sdl_surface->pixels;
510
    page2start=(int)sdl_surface->pixels;
529
    page2start=(int)sdl_surface->pixels;
511
    page3start=(int)sdl_surface->pixels;
530
    page3start=(int)sdl_surface->pixels;	
531
#endif                   // !New!
512
    displayofs = page1start;
532
    displayofs = page1start;
513
    bufferofs = page2start;
533
    bufferofs = page2start;
514
    XFlipPage ();
534
    XFlipPage ();
Lines 637-643 Link Here
637
  VGAMAPMASK(15);
657
  VGAMAPMASK(15);
638
  memset((byte *)(0xa000<<4),color,0x10000);
658
  memset((byte *)(0xa000<<4),color,0x10000);
639
#else
659
#else
660
#ifdef FULLSCREENHACK    // [!New!
661
  memset (backbuf, color, 320*200);
662
#else                    // !New!]
640
  memset (sdl_surface->pixels, color, MAXSCREENWIDTH*MAXSCREENHEIGHT);
663
  memset (sdl_surface->pixels, color, MAXSCREENWIDTH*MAXSCREENHEIGHT);
664
#endif                   // !New!
641
#endif
665
#endif
642
}
666
}
643
667
Lines 653-663 Link Here
653
{
677
{
654
}
678
}
655
679
680
#ifdef FULLSCREENHACK    // [!New!
681
/* This scales a 320x200 image to 640x400 in good ol' DOS fashion.
682
 * This code has been optimized to the max, because it's used a lot.
683
 * This version is about 2.5 times as fast as the trivial implementation. */
684
/*void copyFullScreen(char* source, char* dest)
685
{
686
	int i, j, inRow, outRow1, outRow2;
687
	for(j = 0; j < 200; j++) {
688
		inRow = ylookup[j];
689
		outRow1 = (j<<1)*640;
690
		outRow2 = ((j<<1)+1)*640;
691
		for(i = 0; i < 320; i++) {
692
			dest[outRow2+(i<<1)+1] = dest[outRow2+(i<<1)] =
693
			dest[outRow1+(i<<1)+1] = dest[outRow1+(i<<1)] = source[inRow+i];
694
		}
695
	}
696
}*/
697
// The same as above but for scaling 320x200 to 640x480 so the aspect
698
// ratio is right.
699
void copyFullScreen(char* source, char* dest)
700
{
701
	int i, j, inRow, outRow1, outRow2, outRow3;
702
	for(j = 0; j < 40; j++) {
703
		inRow = 1600*j;
704
		outRow1 = 7680*j;
705
		outRow2 = outRow1+640;
706
		for(i = 0; i < 320; i++) {
707
			dest[outRow2+(i<<1)+1] = dest[outRow2+(i<<1)] =
708
			dest[outRow1+(i<<1)+1] = dest[outRow1+(i<<1)] = source[inRow+i];
709
		}
710
		inRow += 320;
711
		outRow1 += 1280;
712
		outRow2 += 1280;
713
		outRow3 = outRow2+640;
714
		for(i = 0; i < 320; i++) {
715
			dest[outRow3+(i<<1)+1] = dest[outRow3+(i<<1)] =
716
			dest[outRow2+(i<<1)+1] = dest[outRow2+(i<<1)] =
717
			dest[outRow1+(i<<1)+1] = dest[outRow1+(i<<1)] = source[inRow+i];
718
		}
719
		inRow += 320;
720
		outRow1 += 1920;
721
		outRow2 += 1920;
722
		for(i = 0; i < 320; i++) {
723
			dest[outRow2+(i<<1)+1] = dest[outRow2+(i<<1)] =
724
			dest[outRow1+(i<<1)+1] = dest[outRow1+(i<<1)] = source[inRow+i];
725
		}
726
		inRow += 320;
727
		outRow1 += 1280;
728
		outRow2 += 1280;
729
		outRow3 = outRow2+640;
730
		for(i = 0; i < 320; i++) {
731
			dest[outRow3+(i<<1)+1] = dest[outRow3+(i<<1)] =
732
			dest[outRow2+(i<<1)+1] = dest[outRow2+(i<<1)] =
733
			dest[outRow1+(i<<1)+1] = dest[outRow1+(i<<1)] = source[inRow+i];
734
		}
735
		inRow += 320;
736
		outRow1 += 1920;
737
		outRow2 += 1920;
738
		for(i = 0; i < 320; i++) {
739
			dest[outRow2+(i<<1)+1] = dest[outRow2+(i<<1)] =
740
			dest[outRow1+(i<<1)+1] = dest[outRow1+(i<<1)] = source[inRow+i];
741
		}
742
	}
743
}
744
#endif                   // !New!]
656
745
657
/* C version of rt_vh_a.asm */
746
/* C version of rt_vh_a.asm */
658
747
659
void VH_UpdateScreen (void)
748
void VH_UpdateScreen (void)
660
{
749
{
750
#ifdef FULLSCREENHACK    // [!New!
751
	copyFullScreen(backbuf, (char*)sdl_surface->pixels);
752
#endif                   // !New!]
661
	SDL_UpdateRect (SDL_GetVideoSurface (), 0, 0, 0, 0);
753
	SDL_UpdateRect (SDL_GetVideoSurface (), 0, 0, 0, 0);
662
}
754
}
663
755
Lines 685-690 Link Here
685
   if (bufferofs > page3start)
777
   if (bufferofs > page3start)
686
      bufferofs = page1start;
778
      bufferofs = page1start;
687
#else
779
#else
780
#ifdef FULLSCREENHACK    // [!New!
781
   copyFullScreen(backbuf, (char*)sdl_surface->pixels); // !New!
782
#endif                   // !New!]
688
   SDL_UpdateRect (sdl_surface, 0, 0, 0, 0);
783
   SDL_UpdateRect (sdl_surface, 0, 0, 0, 0);
689
#endif
784
#endif
690
}
785
}
(-)rott-1.0/rott/rt_in.c (-1 / +1 lines)
Lines 268-274 Link Here
268
 *                  surface's current flags are used.
268
 *                  surface's current flags are used.
269
 *  @return non-zero on success, zero on failure.
269
 *  @return non-zero on success, zero on failure.
270
 */
270
 */
271
static int attempt_fullscreen_toggle(SDL_Surface **surface, Uint32 *flags)
271
int attempt_fullscreen_toggle(SDL_Surface **surface, Uint32 *flags)
272
{
272
{
273
    long framesize = 0;
273
    long framesize = 0;
274
    void *pixels = NULL;
274
    void *pixels = NULL;
(-)rott-1.0/rott/rt_main.c (-17 / +30 lines)
Lines 111-119 Link Here
111
boolean TILESTATS               = false;
111
boolean TILESTATS               = false;
112
boolean HUD                     = false;
112
boolean HUD                     = false;
113
boolean IS8250                  = false;
113
boolean IS8250                  = false;
114
114
boolean dopefish		= false;
115
boolean dopefish;
115
boolean FullScreen		= false;
116
117
boolean newlevel = false;
116
boolean newlevel = false;
118
boolean infopause;
117
boolean infopause;
119
boolean SOUNDSETUP=false;
118
boolean SOUNDSETUP=false;
Lines 153-159 Link Here
153
void PlayTurboGame( void );
152
void PlayTurboGame( void );
154
void Init_Tables (void);
153
void Init_Tables (void);
155
void CheckRemoteRidicule ( int scancode );
154
void CheckRemoteRidicule ( int scancode );
156
155
extern int attempt_fullscreen_toggle(SDL_Surface **surface, Uint32 *flags);
157
#ifndef DOS
156
#ifndef DOS
158
extern void crash_print (int);
157
extern void crash_print (int);
159
extern int setup_homedir (void);
158
extern int setup_homedir (void);
Lines 372-377 Link Here
372
371
373
   BATTLE_SetOptions( &BATTLE_Options[ battle_StandAloneGame ] );
372
   BATTLE_SetOptions( &BATTLE_Options[ battle_StandAloneGame ] );
374
373
374
   if (FullScreen)
375
     {
376
     SDL_Surface *surface = SDL_GetVideoSurface();
377
     if (surface != NULL)
378
       {
379
       Uint32 sdl_flags = surface->flags;
380
       attempt_fullscreen_toggle(&surface, &sdl_flags);
381
       } 
382
     }
375
   if (turbo || tedlevel)
383
   if (turbo || tedlevel)
376
		{
384
		{
377
      if (modemgame == true)
385
      if (modemgame == true)
Lines 512-520 Link Here
512
{
520
{
513
   char *PStrings[] = {"TEDLEVEL","NOWAIT","NOSOUND","NOW",
521
   char *PStrings[] = {"TEDLEVEL","NOWAIT","NOSOUND","NOW",
514
                       "TRANSPORT","DOPEFISH","SCREENSHOTS",
522
                       "TRANSPORT","DOPEFISH","SCREENSHOTS",
515
                       "MONO","MAPSTATS","TILESTATS","VER","net",
523
                       "MONO","MAPSTATS","TILESTATS","VER","FULLSCREEN","net",
516
                       "PAUSE","SOUNDSETUP","WARP","IS8250","ENABLEVR",
524
                       "PAUSE","SOUNDSETUP","WARP","IS8250","ENABLEVR",
517
                       "TIMELIMIT","MAXTIMELIMIT","NOECHO","DEMOEXIT","QUIET",NULL};
525
                       "TIMELIMIT","MAXTIMELIMIT","NOECHO","DEMOEXIT","QUIET",
526
		       NULL};
518
   int i,n;
527
   int i,n;
519
528
520
   infopause=false;
529
   infopause=false;
Lines 561-566 Link Here
561
      printf ("   CYBERMAN   - Enable check for Cyberman.\n");
570
      printf ("   CYBERMAN   - Enable check for Cyberman.\n");
562
      printf ("   ASSASSIN   - Enable check for Wingman Assassin.\n");
571
      printf ("   ASSASSIN   - Enable check for Wingman Assassin.\n");
563
      printf ("   VER        - Version number.\n");
572
      printf ("   VER        - Version number.\n");
573
      printf ("   FULLSCREEN - Enable Full Screen video mode.\n");
564
      printf ("   MAPSTATS   - Dump Map statistics to ERROR.\n");
574
      printf ("   MAPSTATS   - Dump Map statistics to ERROR.\n");
565
      printf ("   TILESTATS  - Dump Tile statistics to ERROR.\n");
575
      printf ("   TILESTATS  - Dump Tile statistics to ERROR.\n");
566
      printf ("   MONO       - Enable mono-monitor support.\n");
576
      printf ("   MONO       - Enable mono-monitor support.\n");
Lines 604-610 Link Here
604
         MenuFixup ();
614
         MenuFixup ();
605
         break;
615
         break;
606
#endif
616
#endif
607
       case 1:
617
	 case 1:
608
         NoWait = true;
618
         NoWait = true;
609
         break;
619
         break;
610
		 case 2:
620
		 case 2:
Lines 658-663 Link Here
658
         exit (0);
668
         exit (0);
659
         break;
669
         break;
660
       case 11:
670
       case 11:
671
         FullScreen = true;
672
	 break;
673
       case 12:
661
         InitROTTNET();
674
         InitROTTNET();
662
		   numplayers = rottcom->numplayers;
675
		   numplayers = rottcom->numplayers;
663
         if (numplayers>MAXPLAYERS)
676
         if (numplayers>MAXPLAYERS)
Lines 677-700 Link Here
677
               printf("MODEM GAME\n");
690
               printf("MODEM GAME\n");
678
            }
691
            }
679
         break;
692
         break;
680
       case 12:
693
       case 13:
681
         infopause=true;
694
         infopause=true;
682
         break;
695
         break;
683
       case 13:
696
       case 14:
684
          SOUNDSETUP = true;
697
          SOUNDSETUP = true;
685
          break;
698
          break;
686
       case 14:
699
       case 15:
687
          startlevel = (ParseNum(_argv[i + 1])-1);
700
          startlevel = (ParseNum(_argv[i + 1])-1);
688
          break;
701
          break;
689
       case 15:
702
       case 16:
690
          IS8250 = true;
703
          IS8250 = true;
691
          break;
704
          break;
692
       case 16:
705
       case 17:
693
          vrenabled = true;
706
          vrenabled = true;
694
          if (!quiet)
707
          if (!quiet)
695
             printf("Virtual Reality Mode enabled\n");
708
             printf("Virtual Reality Mode enabled\n");
696
          break;
709
          break;
697
       case 17:
710
       case 18:
698
          timelimitenabled = true;
711
          timelimitenabled = true;
699
          timelimit = ParseNum(_argv[i + 1]);
712
          timelimit = ParseNum(_argv[i + 1]);
700
          if (!quiet)
713
          if (!quiet)
Lines 702-718 Link Here
702
          timelimit *= VBLCOUNTER;
715
          timelimit *= VBLCOUNTER;
703
          break;
716
          break;
704
717
705
       case 18:
718
       case 19:
706
          maxtimelimit = ParseNum(_argv[i + 1]);
719
          maxtimelimit = ParseNum(_argv[i + 1]);
707
          maxtimelimit *= VBLCOUNTER;
720
          maxtimelimit *= VBLCOUNTER;
708
          break;
721
          break;
709
       case 19:
722
       case 20:
710
          noecho = true;
723
          noecho = true;
711
          break;
724
          break;
712
       case 20:
725
       case 21:
713
          demoexit = true;
726
          demoexit = true;
714
          break;
727
          break;
715
       case 21:
728
       case 22:
716
          quiet = true;
729
          quiet = true;
717
          break;
730
          break;
718
      }
731
      }

Return to bug 82608