Bug Tracker – Attachment #34: GhostlyDeath's patch for bug #134

View | Details | Raw Unified | Return to bug 134
Collapse All | Expand All

(-)client/src/r_things.cpp (-3 / +18 lines)
Lines 44-49 Link Here
44
44
45
#define MINZ							(FRACUNIT*4)
45
#define MINZ							(FRACUNIT*4)
46
#define BASEYCENTER 					(100)
46
#define BASEYCENTER 					(100)
47
#define BASEYCENTER43 					(80)
47
48
48
//void R_DrawColumn (void);
49
//void R_DrawColumn (void);
49
//void R_DrawFuzzColumn (void);
50
//void R_DrawFuzzColumn (void);
Lines 742-748 Link Here
742
	frac = vis->startfrac;
743
	frac = vis->startfrac;
743
	spryscale = vis->yscale;
744
	spryscale = vis->yscale;
744
	sprtopscreen = centeryfrac - FixedMul (dc_texturemid, spryscale);
745
	sprtopscreen = centeryfrac - FixedMul (dc_texturemid, spryscale);
745
	sprtopscreen -= sprtopscreen%FRACUNIT; // denis - do not attempt to position on a half or quarter pixel!
746
//	sprtopscreen -= sprtopscreen%FRACUNIT; // denis - do not attempt to position on a half or quarter pixel!
746
#ifdef RANGECHECK
747
#ifdef RANGECHECK
747
	patchwidth = (unsigned)(patch->width());
748
	patchwidth = (unsigned)(patch->width());
748
#endif
749
#endif
Lines 1155-1162 Link Here
1155
	// store information in a vissprite
1156
	// store information in a vissprite
1156
	vis = &avis;
1157
	vis = &avis;
1157
	vis->mobjflags = flags;
1158
	vis->mobjflags = flags;
1158
	vis->texturemid = (BASEYCENTER<<FRACBITS)+FRACUNIT/2-
1159
	//vis->texturemid = (BASEYCENTER<<FRACBITS)+FRACUNIT/2-
1159
		(psp->sy-sprframe->topoffset[0]);	// [RH] Moved out of spritetopoffset[]
1160
	//	(psp->sy-sprframe->topoffset[0]);	// [RH] Moved out of spritetopoffset[]
1161
	
1162
	/* Tue, Nov 14, 2006 - 7:07PM EST by Steven Gawroriski, subj: part of the 134 partial bug fix */
1163
	// Let's see what the aspect ratio is......
1164
	if (((screen->width % 320) == 0) && ((screen->height % 200) == 0))// gotta be 8:5
1165
		vis->texturemid = (BASEYCENTER<<FRACBITS)+FRACUNIT/2-
1166
			(psp->sy-sprframe->topoffset[0]);       // [RH] Moved out of spritetopoffset[]
1167
	else if (((screen->width % 320) == 0) && ((screen->height % 240) == 0))// gotta be 4:3
1168
		vis->texturemid = (BASEYCENTER43<<FRACBITS)+FRACUNIT/2-
1169
			(psp->sy-sprframe->topoffset[0]);       // [RH] Moved out of spritetopoffset[]
1170
	else    // eh... Let's just say it's 320x200 like...
1171
		vis->texturemid = (BASEYCENTER<<FRACBITS)+FRACUNIT/2-
1172
			(psp->sy-sprframe->topoffset[0]);       // [RH] Moved out of spritetopoffset[]
1173
	/* no more fixes here */
1174
	
1160
	vis->x1 = x1 < 0 ? 0 : x1;
1175
	vis->x1 = x1 < 0 ? 0 : x1;
1161
	vis->x2 = x2 >= viewwidth ? viewwidth-1 : x2;
1176
	vis->x2 = x2 >= viewwidth ? viewwidth-1 : x2;
1162
	vis->xscale = pspritexscale;
1177
	vis->xscale = pspritexscale;
(-)client/src/r_main.cpp (-2 / +22 lines)
Lines 621-628 Link Here
621
	virtwidth = screen->width >> detailxshift;
621
	virtwidth = screen->width >> detailxshift;
622
	virtheight = screen->height >> detailyshift;
622
	virtheight = screen->height >> detailyshift;
623
623
624
	yaspectmul = (fixed_t)(65536.0f*(320.0f*(float)virtheight/(200.0f*(float)virtwidth)));
624
	//yaspectmul = (fixed_t)(65536.0f*(320.0f*(float)virtheight/(200.0f*(float)virtwidth)));
625
625
	
626
	/*** Begin Bug #134 Partial Fix ***/
627
	// Fix for Bug #134 made at 6:30PM EST on Tue, Nov 14, 2006 by Steven Gawroriski,
628
	// Description: This is where the problem is... I knew it was the aspect ratio but this
629
	// took me a while to find so anyway, the normal value is 320x200 (since doom ran that...)
630
	// and this change would fix this bug on all those damn ports! Time to make some Ifs..
631
	
632
	// Works fine for anything 800x600 and below, there may be 320x200 codestill lurking around
633
	
634
	// 320x200... well 8:5... Choose this no matter what 8:5 Res!
635
	
636
	if (((screen->width % 320) == 0) && ((screen->height % 200) == 0)) // 8:5
637
		yaspectmul = (fixed_t)(65536.0f*(320.0f*(float)virtheight/(200.0f*(float)virtwidth)));
638
	else if (((screen->width % 320) == 0) && ((screen->height % 240) == 0))// 4:3
639
		yaspectmul = (fixed_t)(65536.0f*(320.0f*(float)virtheight/(240.0f*(float)virtwidth)));
640
	else if (((screen->width % 400) == 0) && ((screen->height % 240) == 0))// 5:4
641
		yaspectmul = (fixed_t)(65536.0f*(400.0f*(float)virtheight/(240.0f*(float)virtwidth)));
642
	else    // Aw hell.... Use regular doom ratio instead!!
643
		yaspectmul = (fixed_t)(65536.0f*(320.0f*(float)virtheight/(200.0f*(float)virtwidth)));
644
	/*** End Bug #134 Partial Fix ***/
645
		
626
	colfunc = basecolfunc = R_DrawColumn;
646
	colfunc = basecolfunc = R_DrawColumn;
627
	lucentcolfunc = R_DrawTranslucentColumn;
647
	lucentcolfunc = R_DrawTranslucentColumn;
628
	fuzzcolfunc = R_DrawFuzzColumn;
648
	fuzzcolfunc = R_DrawFuzzColumn;

Return to bug 134