29a30
> #ifndef SUPPORTS_MH_DYNASPEED // Baker change
31a33,34
> #endif // Baker change -
> 
210a214
> #ifndef SUPPORTS_MH_DYNASPEED // Baker change
211a216
> #endif // Baker change -
320a326
> #ifndef SUPPORTS_MH_DYNASPEED // Baker change
321a328
> #endif // Baker change -
358a366
> #ifndef SUPPORTS_MH_DYNASPEED // Baker change
359a368
> #endif // Baker change -
401a411
> #ifndef SUPPORTS_MH_DYNASPEED // Baker change
402a413
> #endif // Baker change -
433a445
> #ifndef SUPPORTS_MH_DYNASPEED // Baker change
434a447
> #endif // Baker change -
708a722,726
> #ifdef SUPPORTS_MH_DYNASPEED // Baker change
> 			base = lightmaps + fa->lightmaptexturenum*4*BLOCK_WIDTH*BLOCK_HEIGHT;
> 			base += fa->light_t * BLOCK_WIDTH * 4 + fa->light_s * 4;
> 			R_BuildLightMap (fa, base, BLOCK_WIDTH*4);
> #else // Baker change +
711a730
> #endif // Baker change -
781a801,805
> #ifdef SUPPORTS_MH_DYNASPEED // Baker change
> 	base = lightmaps + surf->lightmaptexturenum*4*BLOCK_WIDTH*BLOCK_HEIGHT;
> 	base += (surf->light_t * BLOCK_WIDTH + surf->light_s) * 4;
> 	R_BuildLightMap (surf, base, BLOCK_WIDTH*4);
> #else // Baker change +
784a809
> #endif // Baker change -
886a912
> #ifndef SUPPORTS_MH_DYNASPEED // Baker change
899c925
< 
---
> #endif // Baker change -
934a961,963
> #ifdef SUPPORTS_MH_DYNASPEED // Baker change
> 		data = lightmaps+i*BLOCK_WIDTH*BLOCK_HEIGHT*4;
> #else // Baker change +
935a965
> #endif // Baker change -
1092a1123,1146
> #ifdef SUPPORTS_MH_DYNASPEED // Baker change
> 	stride -= smax * 4;
> 	bl = blocklights;
> 	for (i=0 ; i<tmax ; i++, dest += stride)
> 	{
> 		for (j=0 ; j<smax ; j++, dest += 4)
> 		{
> 			if (gl_overbright.value)
> 			{
> 				t = *bl++ >> 8;if (t > 255) t = 255;dest[2] = t;
> 				t = *bl++ >> 8;if (t > 255) t = 255;dest[1] = t;
> 				t = *bl++ >> 8;if (t > 255) t = 255;dest[0] = t;
> 			}
> 			else
> 			{
> 				t = *bl++ >> 7;if (t > 255) t = 255;dest[2] = t;
> 				t = *bl++ >> 7;if (t > 255) t = 255;dest[1] = t;
> 				t = *bl++ >> 7;if (t > 255) t = 255;dest[0] = t;
> 			}
> 
> 			dest[3] = 255;
> 		}
> 	}
> #else // Baker change +
1121a1176
> #endif // Baker change -
1140a1196,1199
> #ifdef SUPPORTS_MH_DYNASPEED // Baker change
> 	glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t, BLOCK_WIDTH, theRect->h, GL_BGRA,
> 		  GL_UNSIGNED_INT_8_8_8_8_REV, lightmaps+(lmap* BLOCK_HEIGHT + theRect->t) *BLOCK_WIDTH*4);
> #else // Baker change +
1142a1202
> #endif // Baker change -
1150a1211,1237
> #ifdef SUPPORTS_MH_DYNASPEED // Baker change
> void R_UploadLightmaps (void)
> {
> 	int lmap;
> 	glRect_t	*theRect;
> 
> 	for (lmap = 0; lmap < MAX_LIGHTMAPS; lmap++)
> 	{
> 		if (!lightmap_modified[lmap])
> 			continue;
> 
> 		GL_Bind (lightmap_textures[lmap]);
> 		lightmap_modified[lmap] = false;
> 
> 		theRect = &lightmap_rectchange[lmap];
> 		glTexSubImage2D(GL_TEXTURE_2D, 0, 0, theRect->t, BLOCK_WIDTH, theRect->h, GL_BGRA,
> 			  GL_UNSIGNED_INT_8_8_8_8_REV, lightmaps+(lmap* BLOCK_HEIGHT + theRect->t) *BLOCK_WIDTH*4);
> 		theRect->l = BLOCK_WIDTH;
> 		theRect->t = BLOCK_HEIGHT;
> 		theRect->h = 0;
> 		theRect->w = 0;
> 
> 		rs_dynamiclightmaps++;
> 	}
> }
> #endif // Baker change +
> 
1175a1263,1267
> #ifdef SUPPORTS_MH_DYNASPEED // Baker change
> 			base = lightmaps + fa->lightmaptexturenum*4*BLOCK_WIDTH*BLOCK_HEIGHT;
> 			base += fa->light_t * BLOCK_WIDTH * 4 + fa->light_s * 4;
> 			R_BuildLightMap (fa, base, BLOCK_WIDTH*4);
> #else // Baker change +
1178a1271
> #endif // Baker change -
1187a1281,1284
> #ifdef SUPPORTS_MH_DYNASPEED // Baker change
> 		glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, BLOCK_WIDTH, BLOCK_HEIGHT, GL_BGRA,
> 			GL_UNSIGNED_INT_8_8_8_8_REV, lightmaps+i*BLOCK_WIDTH*BLOCK_HEIGHT*4);
> #else // Baker change +
1189a1287
> #endif // Baker change -
37a38,43
> #ifdef SUPPORTS_DEMO_RECORD_ANY_TIME // Baker change
> // From ProQuake: space to fill out the demo header for record at any time
> byte	demo_head[3][MAX_MSGLEN];
> int		demo_head_size[2];
> #endif // Baker change +
> 
166a173,180
> #ifdef SUPPORTS_DEMO_RECORD_ANY_TIME // Baker change
> 	if (cls.signon < 2)
> 	{
> 		memcpy(demo_head[cls.signon], net_message.data, net_message.cursize);
> 		demo_head_size[cls.signon] = net_message.cursize;
> 	}
> #endif // Baker change +
> 
216a231,238
> #ifdef TOUCHUP_CANNOT_RECORD_DURING_PLAYDEMO // Baker change
> 	if (cls.demoplayback)
> 	{
> 		Con_Printf ("Can't record during demo playback\n");
> 		return;
> 	}
> #endif // Baker change +
> 
232a255,261
> #ifdef SUPPORTS_DEMO_RECORD_ANY_TIME // Baker change
> 	if (c == 2 && cls.state == ca_connected && cls.signon < 2)
> 	{
> 		Con_Printf("Can't record - try again when connected\n");
> 		return;
> 	}
> #else // Baker change +
237a267
> #endif // Baker change -
274a305,377
> 
> #ifdef SUPPORTS_DEMO_RECORD_ANY_TIME // Baker change
> 	// From ProQuake: initialize the demo file if we're already connected
> 	if (c == 2 && cls.state == ca_connected)
> 	{
> 		byte *data = net_message.data;
> 		int cursize = net_message.cursize;
> 		int i;
> 
> 		for (i = 0 ; i < 2 ; i++)
> 		{
> 			net_message.data = demo_head[i];
> 			net_message.cursize = demo_head_size[i];
> 			CL_WriteDemoMessage();
> 		}
> 
> 		net_message.data = demo_head[2];
> 		SZ_Clear (&net_message);
> 
> 		// current names, colors, and frag counts
> 		for (i=0 ; i < cl.maxclients ; i++)
> 		{
> 			MSG_WriteByte (&net_message, svc_updatename);
> 			MSG_WriteByte (&net_message, i);
> 			MSG_WriteString (&net_message, cl.scores[i].name);
> 			MSG_WriteByte (&net_message, svc_updatefrags);
> 			MSG_WriteByte (&net_message, i);
> 			MSG_WriteShort (&net_message, cl.scores[i].frags);
> 			MSG_WriteByte (&net_message, svc_updatecolors);
> 			MSG_WriteByte (&net_message, i);
> 			MSG_WriteByte (&net_message, cl.scores[i].colors);
> 		}
> 
> 		// send all current light styles
> 		for (i = 0 ; i < MAX_LIGHTSTYLES ; i++)
> 		{
> 			MSG_WriteByte (&net_message, svc_lightstyle);
> 			MSG_WriteByte (&net_message, i);
> 			MSG_WriteString (&net_message, cl_lightstyle[i].map);
> 		}
> 
> // Baker note: What about the CD track or SVC fog ... future consideration.
> 		MSG_WriteByte (&net_message, svc_updatestat);
> 		MSG_WriteByte (&net_message, STAT_TOTALSECRETS);
> 		MSG_WriteLong (&net_message, cl.stats[STAT_TOTALSECRETS]);
> 
> 		MSG_WriteByte (&net_message, svc_updatestat);
> 		MSG_WriteByte (&net_message, STAT_TOTALMONSTERS);
> 		MSG_WriteLong (&net_message, cl.stats[STAT_TOTALMONSTERS]);
> 
> 		MSG_WriteByte (&net_message, svc_updatestat);
> 		MSG_WriteByte (&net_message, STAT_SECRETS);
> 		MSG_WriteLong (&net_message, cl.stats[STAT_SECRETS]);
> 
> 		MSG_WriteByte (&net_message, svc_updatestat);
> 		MSG_WriteByte (&net_message, STAT_MONSTERS);
> 		MSG_WriteLong (&net_message, cl.stats[STAT_MONSTERS]);
> 
> 		// view entity
> 		MSG_WriteByte (&net_message, svc_setview);
> 		MSG_WriteShort (&net_message, cl.viewentity);
> 
> 		// signon
> 		MSG_WriteByte (&net_message, svc_signonnum);
> 		MSG_WriteByte (&net_message, 3);
> 
> 		CL_WriteDemoMessage();
> 
> 		// restore net_message
> 		net_message.data = data;
> 		net_message.cursize = cursize;
> 	}
> #endif // Baker change +
1138a1139,1141
> #ifdef SUPPORTS_MH_DYNASPEED // Baker change
> 	glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, glt->width, glt->height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, data);
> #else // Baker change +
1139a1143
> #endif // Baker change -
1166a1171
> #ifndef SUPPORTS_MH_DYNASPEED // Baker change
1168a1174
> #endif // Baker change -
1251a1258
> 
1254a1262
> #ifndef SUPPORTS_MH_DYNASPEED // Baker change
1256a1265
> #endif // Baker change -
375a376
> #ifndef SUPPORTS_MH_DYNASPEED // Baker change
376a378
> #endif // Baker change -
589a592
> #ifndef SUPPORTS_MH_DYNASPEED // Baker change
590a594
> #endif // Baker change -
197a198,203
> #ifdef SUPPORTS_MH_DYNASPEED // Baker change
> // mh - new defines for lightmapping
> #define GL_BGRA 0x80E1
> #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
> #endif // Baker change +
> 
252a259,260
> 
> 
287a296
> 
288a298
> #ifndef SUPPORTS_MH_DYNASPEED
289a300
> #endif
378a379,382
> #ifdef SUPPORTS_VIEWMODEL_FOV_NEUTRAL // Baker change
> extern cvar_t r_viewmodelfov;
> #endif // Baker change +
> 
409,410c413,431
< 	glTranslatef (paliashdr->scale_origin[0], paliashdr->scale_origin[1], paliashdr->scale_origin[2]);
< 	glScalef (paliashdr->scale[0], paliashdr->scale[1], paliashdr->scale[2]);
---
> 
> #ifdef SUPPORTS_VIEWMODEL_FOV_NEUTRAL // Baker change
> 	// Special handling of view model to keep FOV from altering look.  Pretty good.  Not perfect but rather close.
> 	if (e == &cl.viewent && r_viewmodelfov.value)
> 	{
> #define DEG2RAD( a ) ( (a) * M_PI_DIV_180 )
> 		extern float r_fovx;
> 		float scale = 1.0f / tan( DEG2RAD (r_fovx / 2.0f) ) * r_viewmodelfov.value / 90.0f; // Reverse out fov and do fov we want
> 
> 		glTranslatef (paliashdr->scale_origin[0] * scale, paliashdr->scale_origin[1], paliashdr->scale_origin[2]);
> 		glScalef (paliashdr->scale[0] * scale, paliashdr->scale[1], paliashdr->scale[2]);
> 
> 	}
> 	else
> #endif // Baker change +
> 	{
> 		glTranslatef (paliashdr->scale_origin[0], paliashdr->scale_origin[1], paliashdr->scale_origin[2]);
> 		glScalef (paliashdr->scale[0], paliashdr->scale[1], paliashdr->scale[2]);
> 	}
49a50,57
> #ifdef SUPPORTS_VIEWMODEL_ORIGINAL_POS // Baker change
> cvar_t	r_viewmodelhackpos = {"r_viewmodelhackpos", "1", CVAR_NONE};
> #endif // Baker change +
> #ifdef SUPPORTS_VIEWMODEL_FOV_NEUTRAL // Baker change
> cvar_t	r_viewmodelfov = {"r_viewmodelfov", "90", CVAR_NONE};
> #endif // Baker change +
> 
> 
792a801,814
> #ifdef SUPPORTS_VIEWMODEL_ORIGINAL_POS // Baker change
> 	// fudge position around to keep amount of weapon visible roughly equal with different viewsize
> 	if (r_viewmodelhackpos.value)
> 	{
> 		if (scr_viewsize.value == 110)
> 			view->origin[2] += 1;
> 		else if (scr_viewsize.value == 100)
> 			view->origin[2] += 2;
> 		else if (scr_viewsize.value == 90)
> 			view->origin[2] += 1;
> 		else if (scr_viewsize.value == 80)
> 			view->origin[2] += 0.5;
> 	}
> #endif // Baker change +
917a940,947
> 
> #ifdef SUPPORTS_VIEWMODEL_ORIGINAL_POS	 // Baker change
> 	Cvar_RegisterVariable (&r_viewmodelhackpos);
> #endif // Baker change +
> #ifdef SUPPORTS_VIEWMODEL_FOV_NEUTRAL	 // Baker change
> 	Cvar_RegisterVariable (&r_viewmodelfov);
> #endif // Baker change +
> 
259a260
> 
299a301,306
> 
> #ifdef SUPPORTS_WIDESCREEN_CORRECTION // Baker change
> #define SCREEN_CORRECTION_ASPECT 1.33333f
> 	r_refdef.fov_y = CalcFovy (scr_fov.value, r_refdef.vrect.height * SCREEN_CORRECTION_ASPECT, r_refdef.vrect.height);
> 	r_refdef.fov_x = CalcFovy (r_refdef.fov_y, r_refdef.vrect.height, r_refdef.vrect.width);
> #else // Baker change +
302c309
< 
---
> #endif // Baker change -
1079a1080
> #if !defined(SPEEDUP_SAVEGAME_FAST_NO_FFLUSH) // Baker change (fflush is a major slowdown, let alone running it hundreds of times)
1080a1082
> #endif // Baker change -
27a28,39
> // Baker: 2013-04-11
> #if 1
> #define SUPPORTS_MH_DYNASPEED 					// Dynamic light speed boost. (Big fps speed up sometimes, some video cards very little speed up)
> #define TOUCHUP_CANNOT_RECORD_DURING_PLAYDEMO	// Can't record a demo while playing one (fix crash)
> #define SUPPORTS_DEMO_RECORD_ANY_TIME			// Record a demo at any time
> #define SPEEDUP_SAVEGAME_FAST_NO_FFLUSH			// Fast save games (MH).  Removes a pointless fflush
> #define SUPPORTS_WIDESCREEN_CORRECTION			// Widescreen correction.
> #define SUPPORTS_VIEWMODEL_ORIGINAL_POS			// Some screen resolutions FitzQuake weapon goes partially off-screen
> #define SUPPORTS_VIEWMODEL_FOV_NEUTRAL			// Renders gun the same no matter fov
> #endif 
> 
> 
36a49
> 
38,39c51,52
< #define	QUAKESPASM_VERSION	0.8
< #define	QUAKESPASM_VER_PATCH	8	// helper to print a string like 0.85.8
---
> #define	QUAKESPASM_VERSION	0.9
> #define	QUAKESPASM_VER_PATCH	9	// helper to print a string like 0.85.8
