Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
samsmith001 committed Jul 31, 2020
1 parent a082384 commit 27518df
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Premake5.lua
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"
6 changes: 6 additions & 0 deletions README.md
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.
45 changes: 45 additions & 0 deletions dllmain.cpp
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;
}

5 changes: 5 additions & 0 deletions framework.h
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>
5 changes: 5 additions & 0 deletions pch.cpp
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.
13 changes: 13 additions & 0 deletions pch.h
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 added premake5.exe
Binary file not shown.

0 comments on commit 27518df

Please sign in to comment.