summaryrefslogtreecommitdiff
path: root/apps/plugins/doom/r_main.c
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2006-04-02 01:52:44 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2006-04-02 01:52:44 +0000
commit51db2d3f2cfddfb1c94de1085d130c817bcd953f (patch)
treea8452577070b7febf0ec640d2a065cd7e2c89847 /apps/plugins/doom/r_main.c
parente61b079c26e5eaa12f403da6964ac20282df248e (diff)
downloadrockbox-51db2d3f2cfddfb1c94de1085d130c817bcd953f.zip
rockbox-51db2d3f2cfddfb1c94de1085d130c817bcd953f.tar.gz
rockbox-51db2d3f2cfddfb1c94de1085d130c817bcd953f.tar.bz2
rockbox-51db2d3f2cfddfb1c94de1085d130c817bcd953f.tar.xz
Update adds prboom's high resolution support, also makes the scaling for platforms w/ resolution less then 320x200 much nicer. IDoom's lookup table code has been removed. Also fixed a pallete bug. Some graphic errors are present in menu and status bar. Also updates some headers and output formatting.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9418 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom/r_main.c')
-rw-r--r--apps/plugins/doom/r_main.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/apps/plugins/doom/r_main.c b/apps/plugins/doom/r_main.c
index f79097a..5afb85b 100644
--- a/apps/plugins/doom/r_main.c
+++ b/apps/plugins/doom/r_main.c
@@ -61,6 +61,8 @@ int centerx IBSS_ATTR;
int centery IBSS_ATTR;
fixed_t centerxfrac, centeryfrac;
fixed_t projection;
+// proff 11/06/98: Added for high-res
+fixed_t projectiony;
fixed_t viewx, viewy, viewz;
angle_t viewangle;
fixed_t viewcos, viewsin;
@@ -333,10 +335,17 @@ void R_ExecuteSetViewSize (void)
scaledviewwidth = SCREENWIDTH;
viewheight = SCREENHEIGHT;
}
+ // proff 09/24/98: Added for high-res
+ else if (setblocks == 10)
+ {
+ scaledviewwidth = SCREENWIDTH;
+ viewheight = SCREENHEIGHT-ST_SCALED_HEIGHT;
+ }
else
{
- scaledviewwidth = setblocks*32;
- viewheight = (setblocks*168/10)&~7;
+ // proff 08/17/98: Changed for high-res
+ scaledviewwidth = setblocks*SCREENWIDTH/10;
+ viewheight = (setblocks*(SCREENHEIGHT-ST_SCALED_HEIGHT)/10) & ~7;
}
viewwidth = scaledviewwidth;
@@ -346,14 +355,19 @@ void R_ExecuteSetViewSize (void)
centerxfrac = centerx<<FRACBITS;
centeryfrac = centery<<FRACBITS;
projection = centerxfrac;
+ // proff 11/06/98: Added for high-res
+ projectiony = ((SCREENHEIGHT * centerx * 320) / 200) / SCREENWIDTH * FRACUNIT;
R_InitBuffer (scaledviewwidth, viewheight);
R_InitTextureMapping();
// psprite scales
- pspritescale = FRACUNIT*viewwidth/SCREENWIDTH;
- pspriteiscale = FRACUNIT*SCREENWIDTH/viewwidth;
+ // proff 08/17/98: Changed for high-res
+ pspritescale = FRACUNIT*viewwidth/320;
+ pspriteiscale = FRACUNIT*320/viewwidth;
+ // proff 11/06/98: Added for high-res
+ pspriteyscale = (((SCREENHEIGHT*viewwidth)/SCREENWIDTH) << FRACBITS) / 200;
// thing clipping
for (i=0 ; i<viewwidth ; i++)
@@ -363,7 +377,8 @@ void R_ExecuteSetViewSize (void)
for (i=0 ; i<viewheight ; i++)
{ // killough 5/2/98: reformatted
fixed_t dy = D_abs(((i-viewheight/2)<<FRACBITS)+FRACUNIT/2);
- yslope[i] = FixedDiv ( (viewwidth)/2*FRACUNIT, dy);
+ // proff 08/17/98: Changed for high-res
+ yslope[i] = FixedDiv(projectiony, dy);
}
for (i=0 ; i<viewwidth ; i++)
@@ -379,10 +394,7 @@ void R_ExecuteSetViewSize (void)
int j, startmap = ((LIGHTLEVELS-1-i)*2)*NUMCOLORMAPS/LIGHTLEVELS;
for (j=0 ; j<MAXLIGHTSCALE ; j++)
{
- // CPhipps - use 320 here instead of SCREENWIDTH, otherwise hires is
- // brighter than normal res
- int scale = FixedDiv ((320/2*FRACUNIT), (j+1)<<LIGHTZSHIFT);
- int t, level = startmap - (scale >>= LIGHTSCALESHIFT)/DISTMAP;
+ int t, level = startmap - j*320/viewwidth/DISTMAP;
if (level < 0)
level = 0;
@@ -410,12 +422,14 @@ void R_Init (void)
// CPhipps - R_DrawColumn isn't constant anymore, so must
// initialise in code
colfunc = R_DrawColumn; // current column draw function
- if (SCREENWIDTH<320)
- I_Error("R_Init: Screenwidth(%d) < 320",SCREENWIDTH);
+// if (SCREENWIDTH<320)
+// I_Error("R_Init: Screenwidth(%d) < 320",SCREENWIDTH);
#if 1
+
printf("\nR_LoadTrigTables: ");
R_LoadTrigTables();
#endif
+
printf("\nR_InitData: ");
R_InitData();
R_SetViewSize(screenblocks);