Bug Tracker – Attachment #516: Recalculate texture allocation if R_InitSkyMap changes its height for bug #1127

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

(-)a/client/src/r_sky.cpp (-1 / +12 lines)
Lines 128-133 static void R_InitXToViewAngle() Link Here
128
// [ML] 5/11/06 - Remove sky2 stuffs
128
// [ML] 5/11/06 - Remove sky2 stuffs
129
// [ML] 3/16/10 - Bring it back!
129
// [ML] 3/16/10 - Bring it back!
130
130
131
void R_GenerateLookup(int texnum, int *const errors); // from r_data.cpp
132
131
void R_InitSkyMap()
133
void R_InitSkyMap()
132
{
134
{
133
	if (textureheight == NULL)
135
	if (textureheight == NULL)
Lines 157-163 void R_InitSkyMap() Link Here
157
			p_height = wpatch->height();
159
			p_height = wpatch->height();
158
	}
160
	}
159
161
160
	textures[sky1texture]->height = MAX(t_height,p_height);
162
	if (p_height > t_height)
163
	{
164
		textures[sky1texture]->height = p_height;
165
166
		// if the height changed the precaching has to be redone, so that the
167
		// precalculated allocation size in texturecompositesize[] is correct
168
		int errors;
169
		R_GenerateLookup(sky1texture, &errors);
170
	}
171
161
	textureheight[sky1texture] = textures[sky1texture]->height << FRACBITS;
172
	textureheight[sky1texture] = textures[sky1texture]->height << FRACBITS;
162
	
173
	
163
	skystretch = 0;
174
	skystretch = 0;
(-)a/common/r_data.cpp (-2 / +1 lines)
Lines 336-342 void R_GenerateComposite (int texnum) Link Here
336
// Rewritten by Lee Killough for performance and to fix Medusa bug
336
// Rewritten by Lee Killough for performance and to fix Medusa bug
337
//
337
//
338
338
339
static void R_GenerateLookup(int texnum, int *const errors)
339
void R_GenerateLookup(int texnum, int *const errors)
340
{
340
{
341
	const texture_t *texture = textures[texnum];
341
	const texture_t *texture = textures[texnum];
342
342
343
- 

Return to bug 1127