-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a082384
commit 27518df
Showing
7 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- premake5.lua | ||
workspace "NoCamFreeze" | ||
configurations { "Debug", "Release" } | ||
|
||
project "NoCamFreeze" | ||
kind "SharedLib" | ||
language "C++" | ||
targetdir "bin/%{cfg.buildcfg}" | ||
|
||
files { "**.h", "**.cpp" } | ||
|
||
filter "configurations:Debug" | ||
defines { "DEBUG" } | ||
symbols "On" | ||
targetextension ".asi" | ||
|
||
filter "configurations:Release" | ||
defines { "NDEBUG" } | ||
optimize "On" | ||
targetextension ".asi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# NoCamFreeze | ||
|
||
NoCamFreeze is a standalone mod that disables camera freezing when frozen in SA-MP or by another mod. This is done through switching out the variable used for tracking if controls are disabled for the player in functions | ||
that handle camera movement. There are many other ways to reenable camera movement — this is merely an example of one of them. | ||
|
||
This can be built in to a Visual Studio solution using premake5. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// dllmain.cpp : Defines the entry point for the DLL application. | ||
#include "pch.h" | ||
|
||
void PatchGame() | ||
{ | ||
// Don't do anything until the game reports it has loaded to a certain stage // | ||
while(*(int*)0xC8D4C0 < 9) | ||
Sleep(10); | ||
|
||
// On foot mouse camera // | ||
memset((void*)0x523F4F, 0x0A, 1); // Vertical | ||
memset((void*)0x524036, 0x0A, 1); // Horizontal | ||
|
||
// In vehicle mouse camera // | ||
memset((void*)0x525629, 0x0A, 1); | ||
|
||
// CPad::GetLookLeft // | ||
memset((void*)0x53FDD3, 0x0A, 1); | ||
// CPad::GetLookRight // | ||
memset((void*)0x53FE13, 0x0A, 1); | ||
// CPad::GetLookBehindForCar // | ||
memset((void*)0x53FE73, 0x0A, 1); | ||
// CPad::GetLookBehindForPed // | ||
memset((void*)0x5EFEC3, 0x0A, 1); | ||
} | ||
|
||
BOOL APIENTRY DllMain( HMODULE hModule, | ||
DWORD ul_reason_for_call, | ||
LPVOID lpReserved | ||
) | ||
{ | ||
switch (ul_reason_for_call) | ||
{ | ||
case DLL_PROCESS_ATTACH: | ||
{ | ||
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)PatchGame, NULL, 0, 0); | ||
} | ||
case DLL_THREAD_ATTACH: | ||
case DLL_THREAD_DETACH: | ||
case DLL_PROCESS_DETACH: | ||
break; | ||
} | ||
return TRUE; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers | ||
// Windows Header Files | ||
#include <windows.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// pch.cpp: source file corresponding to the pre-compiled header | ||
|
||
#include "pch.h" | ||
|
||
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// pch.h: This is a precompiled header file. | ||
// Files listed below are compiled only once, improving build performance for future builds. | ||
// This also affects IntelliSense performance, including code completion and many code browsing features. | ||
// However, files listed here are ALL re-compiled if any one of them is updated between builds. | ||
// Do not add files here that you will be updating frequently as this negates the performance advantage. | ||
|
||
#ifndef PCH_H | ||
#define PCH_H | ||
|
||
// add headers that you want to pre-compile here | ||
#include "framework.h" | ||
|
||
#endif //PCH_H |
Binary file not shown.