ref: 3f89128a141080e37c2637d3daae95d29a51ce73
parent: 536426e9e7d8bb653428e389e2051a5929dfb636
author: LTCHIPS <ltchips994@gmail.com>
date: Tue May 15 21:55:26 EDT 2018
added minimum width/height param, also more tweaks
--- a/rott/modexlib.c
+++ b/rott/modexlib.c
@@ -1039,6 +1039,9 @@
//void DrawRotatedScreen(int cx, int cy, byte *destscreen, int angle, int scale, int masked)
+extern int MinScreenWidth;
+extern int MinScreenHeight;
+
void DoScreenRotateScale(int w, int h, SDL_Texture * tex, int angle, float scale)
{
@@ -1049,6 +1052,11 @@
output.w = abs((int)((float)w * scale));
output.h = abs((int)((float)h * scale));
+
+ if (output.w < MinScreenWidth)
+ output.w = MinScreenWidth;
+ if (output.h < MinScreenHeight)
+ output.h = MinScreenHeight;
output.x = (iGLOBAL_SCREENWIDTH - output.w)>>1;
--- a/rott/rt_draw.c
+++ b/rott/rt_draw.c
@@ -3291,7 +3291,7 @@
CalcTics();
CalcTics();
- SDL_SetRelativeMouseMode(SDL_FALSE);
+ //SDL_SetRelativeMouseMode(SDL_FALSE);
for (i=0; i<time; i+=tics)
{ //zxcv
@@ -3305,7 +3305,7 @@
//FreeSDLSurfaceZoom();
- SDL_SetRelativeMouseMode(SDL_TRUE);
+ //SDL_SetRelativeMouseMode(SDL_TRUE);
DrawRotatedScreen(Xh,Yh, (byte *)bufferofs,endangle&(FINEANGLES-1),endscale,0);
FlipPage();
@@ -3387,10 +3387,9 @@
if (option == 1)
{
scale = 1.0;
-
}
- int anglestep = (endAngle - startAngle)/(time*6); //added *6 because it was rotating too effing fast
+ int anglestep = (endAngle - startAngle)/(time*5.52); //added *6 because it was rotating too effing fast
//printf("anglestep: %d \n", anglestep);
//printf("scalestep: %f \n", scalestep);
@@ -3736,11 +3735,20 @@
if (buttons & (1 << 0))
{
if (scale>0)
+ {
scale-=0.01;
+ //printf("new width: %f \n", (float)iGLOBAL_SCREENWIDTH * scale);
+ //printf("new height: %f \n", (float)iGLOBAL_SCREENHEIGHT * scale);
+ //printf("scale: %f \n", scale);
+
+ }
}
else if (buttons & (1 << 1))
{
scale+=0.01;
+ //printf("new width: %f \n", (float)iGLOBAL_SCREENWIDTH * scale);
+ //printf("new height: %f \n", (float)iGLOBAL_SCREENHEIGHT * scale);
+ //printf("scale: %f \n", scale);
}
}
SDL_DestroyTexture(currScreen);
--- a/rott/winrott.c
+++ b/rott/winrott.c
@@ -11,6 +11,9 @@
int iGLOBAL_SCREENBWIDE ;
int iG_SCREENWIDTH;// default screen width in bytes
+int MinScreenWidth;
+int MinScreenHeight;
+
int iGLOBAL_HEALTH_X;
int iGLOBAL_HEALTH_Y;
int iGLOBAL_AMMO_X;
@@ -63,6 +66,11 @@
iG_SCREENWIDTH = iGLOBAL_SCREENWIDTH*(96/320);;// default screen width in bytes
dTopYZANGLELIMIT = (44*FINEANGLES/360);;
+
+ MinScreenWidth = ((float)iGLOBAL_SCREENWIDTH * 0.01875);
+
+ MinScreenHeight = ((float)iGLOBAL_SCREENHEIGHT * 0.02);
+
}
//----------------------------------------------------------------------