Example #1
0
void PatchT4_NoBorder()
{
	r_noborder = Dvar_RegisterBool(0, "r_noborder", DVAR_FLAG_ARCHIVE, "Remove the border when running in windowed mode (set vid_xpos and vid_ypos to 0).");

	windowedWindowStyleHook.initialize(windowedWindowStyleHookLoc, WindowedWindowStyleHookStub, 5, false);
	windowedWindowStyleHook.installHook();
}
void PatchMW2_NoBorder()
{
	r_noborder = Dvar_RegisterBool("r_noborder", true, DVAR_FLAG_SAVED, "Do not use a border in windowed mode");

	windowedWindowStyleHook.initialize(windowedWindowStyleHookLoc, WindowedWindowStyleHookStub, 5, false);
	windowedWindowStyleHook.installHook();
}
Example #3
0
void PatchMW2_Branding()
{
	cg_hideVersion = Dvar_RegisterBool("cg_hideVersion", false, DVAR_FLAG_SAVED, "Hide the version release branding text.");

	drawDevStuffHook.initialize(drawDevStuffHookLoc, DrawDevStuffHookStub);
	drawDevStuffHook.installHook();

	// createwindowexa on winconsole
	static DWORD wcCWEx = (DWORD)CreateWindowExAWrap_WC;
	static DWORD wcGEx = (DWORD)CreateWindowExAWrap_G;
	*(DWORD**)0x4289CA = &wcCWEx;
	*(DWORD**)0x5076AC = &wcGEx;

	// displayed build tag in UI code
	*(DWORD*)0x43F73B = (DWORD)"";

	// console '%s: %s> ' string
	*(DWORD*)0x5A44B4 = (DWORD)(VERSIONSTRING "> ");

	// console version string
	*(DWORD*)0x4B12BB = (DWORD)(VERSIONSTRING " (built " __DATE__ " " __TIME__ ")");

	// version string
	*(DWORD*)0x60BD56 = (DWORD)(VERSIONSTRING " (built " __DATE__ " " __TIME__ ")");

	// set fs_basegame to 'iw4lan' (will apply before fs_game, unlike the above line)
	*(DWORD*)0x6431D1 = (DWORD)"iw4lan";

	// increase font sizes for chat on higher resolutions
	static float float13 = 13.0f;
	static float float10 = 10.0f;
	*(float**)0x5814AE = &float13;
	*(float**)0x5814C8 = &float10;

#ifndef MATCHMAKING
	// use M2 playlists
	strcpy((char*)0x6EE7AC, "mp_playlists_m2");
	*(DWORD*)0x4D47FB = (DWORD)"mp_playlists_m2.ff";
#endif
}
uint32_t Com_FrameWait(int minMsec)
{
	int timeVal;
	int timeValSV;

	if (!com_busyWait)
	{
		com_busyWait = Dvar_RegisterBool("com_busyWait", false, DVAR_FLAG_SAVED, "Use a classic-style idle loop for waiting.");
	}

	do
	{
		if(com_sv_running->current.boolean)
		{
			// should not be needed with IW4's rate settings?
			//timeValSV = SV_SendQueuedPackets();

			timeVal = Com_TimeVal(minMsec);

			//if(timeValSV < timeVal)
				//timeVal = timeValSV;
		}
		else
			timeVal = Com_TimeVal(minMsec);

		if(com_busyWait->current.boolean || timeVal < 1)
			NET_Sleep(0);
		else
			NET_Sleep(timeVal - 1);
	} while(Com_TimeVal(minMsec));

	uint32_t lastTime = com_frameTime;
	Com_EventLoop();
	com_frameTime = Com_Milliseconds();

	return com_frameTime - lastTime;
}