[rott-commits] r282 - trunk/rott
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Feb 11 04:18:33 EST 2015
Author: fabian
Date: 2015-02-11 04:18:33 -0500 (Wed, 11 Feb 2015)
New Revision: 282
Modified:
trunk/rott/_rt_floo.h
trunk/rott/rt_draw.c
trunk/rott/rt_floor.c
Log:
Fix scaling of the sky texture
Modified: trunk/rott/_rt_floo.h
===================================================================
--- trunk/rott/_rt_floo.h 2015-02-11 09:18:02 UTC (rev 281)
+++ trunk/rott/_rt_floo.h 2015-02-11 09:18:33 UTC (rev 282)
@@ -23,6 +23,6 @@
//#define MAXVIEWHEIGHT MAXSCREENHEIGHT
#define MAXSKYSEGS 2048
#define MAXSKYDATA 8
-#define MINSKYHEIGHT 0//148 //bna++ sky change here
+#define MINSKYHEIGHT 148
#endif
Modified: trunk/rott/rt_draw.c
===================================================================
--- trunk/rott/rt_draw.c 2015-02-11 09:18:02 UTC (rev 281)
+++ trunk/rott/rt_draw.c 2015-02-11 09:18:33 UTC (rev 282)
@@ -6009,6 +6009,7 @@
void DrawSkyPost (byte * buf, byte * src, int height)
{
+#if 0
// bna fix for missing sky by high res eg 800x600
// when sky is >400 (max skyheight) then reverse mouintain to missing spot
// there should be 200 line of mouintain (400+200) = 600 height lines
@@ -6033,13 +6034,17 @@
}
// bna section end
}
- else {
+ else
+#endif
+ {
+ int i = 0;
+ const byte *orig_src = src;
// org code
while (height--) {
*buf = shadingtable[*src];
buf += linewidth;
- src++;
+ src = orig_src + (++i*200/iGLOBAL_SCREENHEIGHT);
}
//
}
Modified: trunk/rott/rt_floor.c
===================================================================
--- trunk/rott/rt_floor.c 2015-02-11 09:18:02 UTC (rev 281)
+++ trunk/rott/rt_floor.c 2015-02-11 09:18:33 UTC (rev 282)
@@ -105,14 +105,15 @@
else
shadingtable=colormap+(1<<12);
- ofs=(((maxheight)-(player->z))>>3)+(centery-(viewheight>>1));
+ ofs=(((maxheight)-(player->z))>>3)+(centery*200/iGLOBAL_SCREENHEIGHT-((viewheight*200/iGLOBAL_SCREENHEIGHT)>>1));
+
if (ofs>centerskypost)
{
ofs=centerskypost;
}
- else if (((centerskypost-ofs)+viewheight)>1799)
+ else if (((centerskypost-ofs)+viewheight*200/iGLOBAL_SCREENHEIGHT)>1799)
{
- ofs=-(1799-(centerskypost+viewheight));
+ ofs=-(1799-(centerskypost+viewheight*200/iGLOBAL_SCREENHEIGHT));
}
//ofs=centerskypost;
#ifdef DOS
More information about the rott-commits
mailing list