ref: 77cf26af2bff5a593a232ff0dcdeef35ad652f49
parent: df37e45fb5c51071877e6f1c782234c72df05b24
author: LTCHIPS <ltchips994@gmail.com>
date: Thu Mar 22 22:13:54 EDT 2018
Added borderless window option to launch commands, fixed Fadein/Out not working
--- a/rott/modexlib.c
+++ b/rott/modexlib.c
@@ -453,7 +453,7 @@
//SDL_ShowCursor (0);
// sdl_surface = SDL_SetVideoMode (320, 200, 8, flags);
- //SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
+ SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest");
if (sdl_fullscreen)
flags = SDL_WINDOW_FULLSCREEN_DESKTOP;
--- a/rott/modexlib.h
+++ b/rott/modexlib.h
@@ -128,6 +128,7 @@
void GraphicsMode ( void );
+void ChangeResolution( int, int);
void SetTextMode ( void );
void VL_SetVGAPlaneMode ( void );
void VL_ClearBuffer (byte *buf, byte color);
--- a/rott/rt_main.c
+++ b/rott/rt_main.c
@@ -168,6 +168,8 @@
extern int iDropDemo;
extern boolean iG_aimCross;
extern boolean sdl_fullscreen;
+extern boolean borderWindow;
+extern boolean borderlessWindow;
extern void ComSetTime ( void );
extern void VH_UpdateScreen (void);
@@ -843,7 +845,7 @@
char *newargs[99];
int i, arg, argnum = 0;
char *tempstr = NULL;
- char *PStrings[] = {"AIM", "FULLSCREEN", "WINDOW", "RESOLUTION", NULL };
+ char *PStrings[] = {"AIM", "FULLSCREEN", "WINDOW", "BORDERLESS", "RESOLUTION", NULL };
// These must be checked here so that they can override the cfg file
for (i = 1; i < _argc; i++)
@@ -856,11 +858,20 @@
break;
case 1:
sdl_fullscreen = 1;
+ borderWindow = 0;
+ borderlessWindow = 0;
break;
case 2:
sdl_fullscreen = 0;
+ borderWindow = 1;
+ borderlessWindow = 0;
break;
case 3:
+ sdl_fullscreen = 0;
+ borderWindow = 0;
+ borderlessWindow = 1;
+ break;
+ case 4:
i++;
if (i < _argc)
{
@@ -1146,6 +1157,8 @@
{
//no longer needed in SDL2
//SDL_WarpMouse(iGLOBAL_SCREENWIDTH<<1, iGLOBAL_SCREENHEIGHT<<1);
+
+
if ( playstate == ex_battledone )
{
while( damagecount > 0 )
--- a/rott/rt_ted.c
+++ b/rott/rt_ted.c
@@ -1214,48 +1214,20 @@
DrawNormalSprite ((int)(newPrecacheBarX + newPrecacheBar1LedX+(Gs*(lastmem<<2))),
(int)(newPrecacheBarY + newPrecacheBar1LedY),W_GetNumForName ("led1"));//led1 progressbar
- DrawNormalSprite ((int)(newPrecacheBarX + newPrecacheBar1LedX+(Gs*(lastmem<<2))),
+ if (iGLOBAL_SCREENWIDTH > 320)
+ {
+ DrawNormalSprite ((int)(newPrecacheBarX + newPrecacheBar1LedX+(Gs*(lastmem<<2))),
(int)(newPrecacheBarY + newPrecacheBar1LedY + 3),W_GetNumForName ("led1"));//led1 progressbar
- DrawNormalSprite ((int)(newPrecacheBarX + newPrecacheBar1LedX+(Gs*(lastmem<<2)) + 3),
- (int)(newPrecacheBarY + newPrecacheBar1LedY),W_GetNumForName ("led1"));//led1 progressbar
+ }
DrawNormalSprite ((int)(newPrecacheBarX + newPrecacheBar1LedX+(Gs*(lastmem<<2)) + 3),
+ (int)(newPrecacheBarY + newPrecacheBar1LedY),W_GetNumForName ("led1"));//led1 progressbar
+ if (iGLOBAL_SCREENWIDTH > 320)
+ {
+ DrawNormalSprite ((int)(newPrecacheBarX + newPrecacheBar1LedX+(Gs*(lastmem<<2)) + 3),
(int)(newPrecacheBarY + newPrecacheBar1LedY + 3),W_GetNumForName ("led1"));//led1 progressbar
-
-/*
- if ( iGLOBAL_SCREENWIDTH == 320) {
- DrawNormalSprite (PRECACHEBARX+PRECACHELED1X+(lastmem<<2),
- PRECACHEBARY+PRECACHELED1Y,
- W_GetNumForName ("led1"));//led1 progressbar
- } else if ( iGLOBAL_SCREENWIDTH == 640) {
- if (iGLOBAL_SCREENHEIGHT == 400)
- {
- DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar1LedX+(Gs*(lastmem<<2))),
- (int)(newPrecacheBarY + newPrecacheBar1LedY),W_GetNumForName ("led1"));//led1 progressbar
- DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar1LedX+(Gs*(lastmem<<2))),
- (int)(newPrecacheBarY + newPrecacheBar1LedY + 3),W_GetNumForName ("led1"));//led1 progressbar
- DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar1LedX+(Gs*(lastmem<<2)) + 3),
- (int)(newPrecacheBarY + newPrecacheBar1LedY),W_GetNumForName ("led1"));//led1 progressbar
- DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar1LedX+(Gs*(lastmem<<2)) + 3),
- (int)(newPrecacheBarY + newPrecacheBar1LedY + 3),W_GetNumForName ("led1"));//led1 progressbar
- }
- else
- {
- DrawNormalSprite (72+(Gs*(lastmem<<2)),446,W_GetNumForName ("led1"));//led1 progressbar
- DrawNormalSprite (72+(Gs*(lastmem<<2)),446+3,W_GetNumForName ("led1"));//led1 progressbar
- DrawNormalSprite (72+3+(Gs*(lastmem<<2)),446,W_GetNumForName ("led1"));//led1 progressbar
- DrawNormalSprite (72+3+(Gs*(lastmem<<2)),446+3,W_GetNumForName ("led1"));//led1 progressbar
- }
-
- } else if ( iGLOBAL_SCREENWIDTH == 800) {
- DrawNormalSprite (91+(Gs*(lastmem<<2)),559,W_GetNumForName ("led1"));//led1 progressbar
- DrawNormalSprite (91+(Gs*(lastmem<<2)),559+3,W_GetNumForName ("led1"));//led1 progressbar
- DrawNormalSprite (91+3+(Gs*(lastmem<<2)),559,W_GetNumForName ("led1"));//led1 progressbar
- DrawNormalSprite (91+3+(Gs*(lastmem<<2)),559+3,W_GetNumForName ("led1"));//led1 progressbar
}
-*/
-
lastmem++;
VW_UpdateScreen (); // was missing, fixed
}
@@ -1264,45 +1236,15 @@
{
DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2))),
(int)(newPrecacheBarY + newPrecacheBar2LedY),W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2))),
- (int)(newPrecacheBarY + newPrecacheBar2LedY + 3),W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2)) + 3),
- (int)(newPrecacheBarY + newPrecacheBar2LedY),W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2)) + 3),
- (int)(newPrecacheBarY + newPrecacheBar2LedY + 3),W_GetNumForName ("led2"));//led2 progressbar
-/*
- if ( iGLOBAL_SCREENWIDTH == 320) {
- DrawNormalSprite (PRECACHEBARX+PRECACHELED2X+(lastcache<<2),
- PRECACHEBARY+PRECACHELED2Y,
- W_GetNumForName ("led2"));//led2 progressbar
- }
- else if ( iGLOBAL_SCREENWIDTH == 640) {
- if (iGLOBAL_SCREENHEIGHT == 400)
- {
- DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2))),
- (int)(newPrecacheBarY + newPrecacheBar2LedY),W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2))),
- (int)(newPrecacheBarY + newPrecacheBar2LedY + 3),W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2)) + 3),
- (int)(newPrecacheBarY + newPrecacheBar2LedY),W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2)) + 3),
- (int)(newPrecacheBarY + newPrecacheBar2LedY + 3),W_GetNumForName ("led2"));//led2 progressbar
- }
- else
- {
- DrawNormalSprite (72+(Gs*(lastcache<<2)),458,W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite (72+(Gs*(lastcache<<2)),458+3,W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite (72+3+(Gs*(lastcache<<2)),458,W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite (72+3+(Gs*(lastcache<<2)),458+3,W_GetNumForName ("led2"));//led2 progressbar
- }
-
- } else if ( iGLOBAL_SCREENWIDTH == 800) {
- DrawNormalSprite (91+(Gs*(lastcache<<2)),573,W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite (91+(Gs*(lastcache<<2)),573+3,W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite (91+3+(Gs*(lastcache<<2)),573,W_GetNumForName ("led2"));//led2 progressbar
- DrawNormalSprite (91+3+(Gs*(lastcache<<2)),573+3,W_GetNumForName ("led2"));//led2 progressbar
+ if (iGLOBAL_SCREENWIDTH > 320)
+ {
+ DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2))),
+ (int)(newPrecacheBarY + newPrecacheBar2LedY + 3),W_GetNumForName ("led2"));//led2 progressbar
+ DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2)) + 3),
+ (int)(newPrecacheBarY + newPrecacheBar2LedY),W_GetNumForName ("led2"));//led2 progressbar
+ DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2)) + 3),
+ (int)(newPrecacheBarY + newPrecacheBar2LedY + 3),W_GetNumForName ("led2"));//led2 progressbar
}
-*/
DisableScreenStretch();//bna++
VW_UpdateScreen ();//bna++
lastcache++;
--- a/rott/rt_vid.c
+++ b/rott/rt_vid.c
@@ -894,6 +894,7 @@
WaitVBL ();
VL_SetPalette (&palette2[0][0]);
+ VH_UpdateScreen();
}
//
@@ -1004,6 +1005,7 @@
WaitVBL ();
VL_SetPalette (&palette2[0][0]);
+ VH_UpdateScreen();
}
//
--- a/rott/winrott.c
+++ b/rott/winrott.c
@@ -37,7 +37,7 @@
void RecalculateFocalWidth(void)
{
iGLOBAL_FOCALWIDTH = 160 - FocalWidthOffset;
- dGLOBAL_FPFOCALWIDTH = 160.0 - FocalWidthOffset;
+ dGLOBAL_FPFOCALWIDTH = 160 - FocalWidthOffset;
}
void SetRottScreenRes (int Width, int Height)
@@ -63,64 +63,6 @@
iG_SCREENWIDTH = iGLOBAL_SCREENWIDTH*(96/320);;// default screen width in bytes
dTopYZANGLELIMIT = (44*FINEANGLES/360);;
-
-/*
- if (iGLOBAL_SCREENWIDTH == 320) {
- iGLOBAL_FOCALWIDTH = 160 - FocalWidthOffset;
- dGLOBAL_FPFOCALWIDTH = 160.0 - FocalWidthOffset;
- iGLOBAL_HEALTH_X = 20;
- iGLOBAL_HEALTH_Y = 185;
- iGLOBAL_AMMO_X = 300;
- iGLOBAL_AMMO_Y = 184;
-
- dTopYZANGLELIMIT = (44*FINEANGLES/360);;
- }
- if (iGLOBAL_SCREENWIDTH == 640) {
- if (iGLOBAL_SCREENHEIGHT == 400)
- {
- iGLOBAL_FOCALWIDTH = 180 - FocalWidthOffset;
- dGLOBAL_FPFOCALWIDTH = 180.0 - FocalWidthOffset ;
- iGLOBAL_HEALTH_X = 180;
- iGLOBAL_HEALTH_Y = 400 - 16;
- iGLOBAL_AMMO_X = 460;
- iGLOBAL_AMMO_Y = 400 - 16;
-
- dTopYZANGLELIMIT = (42*FINEANGLES/360);;
-
- }
- else
- {
- iGLOBAL_FOCALWIDTH = 180 - FocalWidthOffset;
- dGLOBAL_FPFOCALWIDTH = 180.0 - FocalWidthOffset ;
- iGLOBAL_HEALTH_X = 40;//20*2;
- iGLOBAL_HEALTH_Y = 466;//(185*2)+16;
- iGLOBAL_AMMO_X = 600;//300*2;
- iGLOBAL_AMMO_Y = 464;//480-16;
-
- dTopYZANGLELIMIT = (42*FINEANGLES/360);;
-
- }
-
- }
- if (iGLOBAL_SCREENWIDTH == 800) {
- iGLOBAL_FOCALWIDTH = 200 - FocalWidthOffset;
- dGLOBAL_FPFOCALWIDTH = 200.0 - FocalWidthOffset;
- iGLOBAL_HEALTH_X = 40;//20*2;
- iGLOBAL_HEALTH_Y = 585;//(185/200)*600;
- iGLOBAL_AMMO_X = 750;//(300/320)*800;
- iGLOBAL_AMMO_Y = 584;//600-16;
-
- dTopYZANGLELIMIT = (90*FINEANGLES/360);;
- }
-*/
-
- //dYZANGLELIMIT = (12*FINEANGLES/360);
- //#define YZANGLELIMIT (12*FINEANGLES/360)//bna--(30*FINEANGLES/360)
-
- //#define TopYZANGLELIMIT (44*FINEANGLES/360)//bna added
-
-// GetCurrentDirectory(sizeof(ApogeePath),ApogeePath);// curent directory name
-
}
//----------------------------------------------------------------------