diff options
Diffstat (limited to 'apps/plugins/doom/r_main.c')
-rw-r--r-- | apps/plugins/doom/r_main.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/apps/plugins/doom/r_main.c b/apps/plugins/doom/r_main.c index f79097a969..5afb85b3ce 100644 --- a/apps/plugins/doom/r_main.c +++ b/apps/plugins/doom/r_main.c | |||
@@ -61,6 +61,8 @@ int centerx IBSS_ATTR; | |||
61 | int centery IBSS_ATTR; | 61 | int centery IBSS_ATTR; |
62 | fixed_t centerxfrac, centeryfrac; | 62 | fixed_t centerxfrac, centeryfrac; |
63 | fixed_t projection; | 63 | fixed_t projection; |
64 | // proff 11/06/98: Added for high-res | ||
65 | fixed_t projectiony; | ||
64 | fixed_t viewx, viewy, viewz; | 66 | fixed_t viewx, viewy, viewz; |
65 | angle_t viewangle; | 67 | angle_t viewangle; |
66 | fixed_t viewcos, viewsin; | 68 | fixed_t viewcos, viewsin; |
@@ -333,10 +335,17 @@ void R_ExecuteSetViewSize (void) | |||
333 | scaledviewwidth = SCREENWIDTH; | 335 | scaledviewwidth = SCREENWIDTH; |
334 | viewheight = SCREENHEIGHT; | 336 | viewheight = SCREENHEIGHT; |
335 | } | 337 | } |
338 | // proff 09/24/98: Added for high-res | ||
339 | else if (setblocks == 10) | ||
340 | { | ||
341 | scaledviewwidth = SCREENWIDTH; | ||
342 | viewheight = SCREENHEIGHT-ST_SCALED_HEIGHT; | ||
343 | } | ||
336 | else | 344 | else |
337 | { | 345 | { |
338 | scaledviewwidth = setblocks*32; | 346 | // proff 08/17/98: Changed for high-res |
339 | viewheight = (setblocks*168/10)&~7; | 347 | scaledviewwidth = setblocks*SCREENWIDTH/10; |
348 | viewheight = (setblocks*(SCREENHEIGHT-ST_SCALED_HEIGHT)/10) & ~7; | ||
340 | } | 349 | } |
341 | 350 | ||
342 | viewwidth = scaledviewwidth; | 351 | viewwidth = scaledviewwidth; |
@@ -346,14 +355,19 @@ void R_ExecuteSetViewSize (void) | |||
346 | centerxfrac = centerx<<FRACBITS; | 355 | centerxfrac = centerx<<FRACBITS; |
347 | centeryfrac = centery<<FRACBITS; | 356 | centeryfrac = centery<<FRACBITS; |
348 | projection = centerxfrac; | 357 | projection = centerxfrac; |
358 | // proff 11/06/98: Added for high-res | ||
359 | projectiony = ((SCREENHEIGHT * centerx * 320) / 200) / SCREENWIDTH * FRACUNIT; | ||
349 | 360 | ||
350 | R_InitBuffer (scaledviewwidth, viewheight); | 361 | R_InitBuffer (scaledviewwidth, viewheight); |
351 | 362 | ||
352 | R_InitTextureMapping(); | 363 | R_InitTextureMapping(); |
353 | 364 | ||
354 | // psprite scales | 365 | // psprite scales |
355 | pspritescale = FRACUNIT*viewwidth/SCREENWIDTH; | 366 | // proff 08/17/98: Changed for high-res |
356 | pspriteiscale = FRACUNIT*SCREENWIDTH/viewwidth; | 367 | pspritescale = FRACUNIT*viewwidth/320; |
368 | pspriteiscale = FRACUNIT*320/viewwidth; | ||
369 | // proff 11/06/98: Added for high-res | ||
370 | pspriteyscale = (((SCREENHEIGHT*viewwidth)/SCREENWIDTH) << FRACBITS) / 200; | ||
357 | 371 | ||
358 | // thing clipping | 372 | // thing clipping |
359 | for (i=0 ; i<viewwidth ; i++) | 373 | for (i=0 ; i<viewwidth ; i++) |
@@ -363,7 +377,8 @@ void R_ExecuteSetViewSize (void) | |||
363 | for (i=0 ; i<viewheight ; i++) | 377 | for (i=0 ; i<viewheight ; i++) |
364 | { // killough 5/2/98: reformatted | 378 | { // killough 5/2/98: reformatted |
365 | fixed_t dy = D_abs(((i-viewheight/2)<<FRACBITS)+FRACUNIT/2); | 379 | fixed_t dy = D_abs(((i-viewheight/2)<<FRACBITS)+FRACUNIT/2); |
366 | yslope[i] = FixedDiv ( (viewwidth)/2*FRACUNIT, dy); | 380 | // proff 08/17/98: Changed for high-res |
381 | yslope[i] = FixedDiv(projectiony, dy); | ||
367 | } | 382 | } |
368 | 383 | ||
369 | for (i=0 ; i<viewwidth ; i++) | 384 | for (i=0 ; i<viewwidth ; i++) |
@@ -379,10 +394,7 @@ void R_ExecuteSetViewSize (void) | |||
379 | int j, startmap = ((LIGHTLEVELS-1-i)*2)*NUMCOLORMAPS/LIGHTLEVELS; | 394 | int j, startmap = ((LIGHTLEVELS-1-i)*2)*NUMCOLORMAPS/LIGHTLEVELS; |
380 | for (j=0 ; j<MAXLIGHTSCALE ; j++) | 395 | for (j=0 ; j<MAXLIGHTSCALE ; j++) |
381 | { | 396 | { |
382 | // CPhipps - use 320 here instead of SCREENWIDTH, otherwise hires is | 397 | int t, level = startmap - j*320/viewwidth/DISTMAP; |
383 | // brighter than normal res | ||
384 | int scale = FixedDiv ((320/2*FRACUNIT), (j+1)<<LIGHTZSHIFT); | ||
385 | int t, level = startmap - (scale >>= LIGHTSCALESHIFT)/DISTMAP; | ||
386 | 398 | ||
387 | if (level < 0) | 399 | if (level < 0) |
388 | level = 0; | 400 | level = 0; |
@@ -410,12 +422,14 @@ void R_Init (void) | |||
410 | // CPhipps - R_DrawColumn isn't constant anymore, so must | 422 | // CPhipps - R_DrawColumn isn't constant anymore, so must |
411 | // initialise in code | 423 | // initialise in code |
412 | colfunc = R_DrawColumn; // current column draw function | 424 | colfunc = R_DrawColumn; // current column draw function |
413 | if (SCREENWIDTH<320) | 425 | // if (SCREENWIDTH<320) |
414 | I_Error("R_Init: Screenwidth(%d) < 320",SCREENWIDTH); | 426 | // I_Error("R_Init: Screenwidth(%d) < 320",SCREENWIDTH); |
415 | #if 1 | 427 | #if 1 |
428 | |||
416 | printf("\nR_LoadTrigTables: "); | 429 | printf("\nR_LoadTrigTables: "); |
417 | R_LoadTrigTables(); | 430 | R_LoadTrigTables(); |
418 | #endif | 431 | #endif |
432 | |||
419 | printf("\nR_InitData: "); | 433 | printf("\nR_InitData: "); |
420 | R_InitData(); | 434 | R_InitData(); |
421 | R_SetViewSize(screenblocks); | 435 | R_SetViewSize(screenblocks); |