Skip to content

Commit

Permalink
Merge branch 'master' into fixs-reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladik01-11 authored Sep 22, 2024
2 parents cba3ac5 + 746c684 commit 718bdb6
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 22 deletions.
2 changes: 1 addition & 1 deletion libs/imgui
Submodule imgui updated 65 files
+64 −4 .github/workflows/build.yml
+12 −0 .github/workflows/manual.yml
+8 −5 backends/imgui_impl_allegro5.cpp
+1 −0 backends/imgui_impl_allegro5.h
+1 −0 backends/imgui_impl_android.h
+1 −0 backends/imgui_impl_dx10.h
+1 −0 backends/imgui_impl_dx11.h
+2 −0 backends/imgui_impl_dx12.h
+1 −0 backends/imgui_impl_dx9.h
+51 −15 backends/imgui_impl_glfw.cpp
+4 −0 backends/imgui_impl_glfw.h
+1 −0 backends/imgui_impl_glut.h
+2 −0 backends/imgui_impl_metal.h
+1 −0 backends/imgui_impl_opengl2.h
+1 −0 backends/imgui_impl_opengl3.cpp
+1 −1 backends/imgui_impl_opengl3.h
+2 −0 backends/imgui_impl_osx.h
+9 −4 backends/imgui_impl_osx.mm
+65 −28 backends/imgui_impl_sdl2.cpp
+1 −0 backends/imgui_impl_sdl2.h
+97 −39 backends/imgui_impl_sdl3.cpp
+2 −2 backends/imgui_impl_sdl3.h
+1 −0 backends/imgui_impl_sdlrenderer2.h
+2 −0 backends/imgui_impl_sdlrenderer3.cpp
+3 −0 backends/imgui_impl_sdlrenderer3.h
+6 −2 backends/imgui_impl_vulkan.cpp
+1 −1 backends/imgui_impl_vulkan.h
+1 −0 backends/imgui_impl_wgpu.h
+2 −0 backends/imgui_impl_win32.cpp
+1 −0 backends/imgui_impl_win32.h
+20 −20 docs/BACKENDS.md
+224 −45 docs/CHANGELOG.txt
+6 −39 docs/EXAMPLES.md
+9 −8 docs/FAQ.md
+5 −1 docs/FONTS.md
+7 −7 docs/README.md
+1 −2 docs/TODO.txt
+1 −1 examples/example_android_opengl3/android/app/src/main/AndroidManifest.xml
+5 −0 examples/example_glfw_opengl2/main.cpp
+5 −0 examples/example_glfw_opengl3/main.cpp
+5 −0 examples/example_glfw_vulkan/main.cpp
+0 −1 examples/example_glfw_wgpu/CMakeLists.txt
+5 −0 examples/example_glfw_wgpu/main.cpp
+1 −1 examples/example_null/Makefile
+5 −0 examples/example_sdl2_directx11/main.cpp
+5 −0 examples/example_sdl2_opengl2/main.cpp
+5 −0 examples/example_sdl2_opengl3/main.cpp
+6 −1 examples/example_sdl2_sdlrenderer2/main.cpp
+5 −0 examples/example_sdl2_vulkan/main.cpp
+3 −3 examples/example_sdl3_opengl3/README.md
+6 −1 examples/example_sdl3_opengl3/main.cpp
+9 −1 examples/example_sdl3_sdlrenderer3/main.cpp
+8 −0 examples/example_win32_opengl3/build_mingw.bat
+5 −0 examples/example_win32_opengl3/main.cpp
+4 −3 examples/libs/emscripten/emscripten_mainloop_stub.h
+6 −5 imconfig.h
+348 −174 imgui.cpp
+132 −92 imgui.h
+436 −165 imgui_demo.cpp
+13 −5 imgui_draw.cpp
+78 −71 imgui_internal.h
+58 −42 imgui_tables.cpp
+480 −349 imgui_widgets.cpp
+63 −35 imstb_textedit.h
+3 −2 misc/freetype/imgui_freetype.cpp
4 changes: 4 additions & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
Options and Actions
--]]

newoption {
trigger = "script-tracing",
description = "Enable script command trace logging (Slow!)"
}
newoption {
trigger = "outdir",
value = "path",
Expand Down
8 changes: 7 additions & 1 deletion source/game_sa/Scripts/RunningScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,13 @@ OpcodeResult CRunningScript::ProcessOneCommand() {
};
} op = { CTheScripts::Read2BytesFromScript(m_IP) };

SPDLOG_LOGGER_TRACE(logger, "[{}][IP: {:#x} + {:#x}]: {} [{:#x}]", m_szName, LOG_PTR(m_pBaseIP), LOG_PTR(m_IP - m_pBaseIP), notsa::script::GetScriptCommandName((eScriptCommands)op.command), (size_t)op.command);
#ifdef NOTSA_SCRIPT_TRACING
// snprintf is faster (in debug at least) - Gotta stick to it for now
char msg[4096];
sprintf_s(msg, "[%s][IP: 0x%X + 0x%X]: %s [0x%X]", m_szName, LOG_PTR(m_pBaseIP), LOG_PTR(m_IP - m_pBaseIP), notsa::script::GetScriptCommandName((eScriptCommands)op.command).data(), (size_t)op.command);
SPDLOG_LOGGER_TRACE(logger, msg);
//SPDLOG_LOGGER_TRACE(logger, "[{}][IP: {:#x} + {:#x}]: {} [{:#x}]", m_szName, LOG_PTR(m_pBaseIP), LOG_PTR(m_IP - m_pBaseIP), notsa::script::GetScriptCommandName((eScriptCommands)op.command), (size_t)op.command);
#endif

m_bNotFlag = op.notFlag;

Expand Down
35 changes: 16 additions & 19 deletions source/game_sa/Weather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,29 +310,26 @@ void CWeather::UpdateInTunnelness() {
plugin::Call<0x72B630>();
}

// 0x72A640
void CWeather::UpdateWeatherRegion(CVector* posn) {
CVector camPos = TheCamera.GetPosition();
if (posn) {
camPos = *posn;
// Based on 0x72A640
eWeatherRegion CWeather::FindWeatherRegion(CVector2D pos) {
if (pos.x > 1000.0f && pos.y > 910.0f) {
return WEATHER_REGION_LV;
}
if (camPos.x > 1000.0f && camPos.y > 910.0f) {
WeatherRegion = WEATHER_REGION_LV;
return;
if (pos.x > -850.0f && pos.x < 1000.0f && pos.y > 1280.0f) {
return WEATHER_REGION_DESERT;
}
if (camPos.x > -850.0f && camPos.x < 1000.0f && camPos.y > 1280.0f) {
WeatherRegion = WEATHER_REGION_DESERT;
return;
if (pos.x < -1430.0f && pos.y > -580.0f && pos.y < 1430.0f) {
return WEATHER_REGION_SF;
}
if (camPos.x < -1430.0f && camPos.y > 580.0f && camPos.y < 1430.0f) {
WeatherRegion = WEATHER_REGION_SF;
return;
if (pos.x > 250.0f && pos.x < 3000.0f && pos.y > -3000.0f && pos.y < -850.0f) {
return WEATHER_REGION_LA;
}
if (camPos.x > 250.0f && camPos.x < 3000.0f && camPos.y > -3000.0f && camPos.y < -850.0f) { // todo: maybe wrong
WeatherRegion = WEATHER_REGION_LA;
return;
}
WeatherRegion = WEATHER_REGION_DEFAULT;
return WEATHER_REGION_DEFAULT;
}

// 0x72A640
void CWeather::UpdateWeatherRegion(CVector* posn) {
WeatherRegion = FindWeatherRegion(posn ? *posn : TheCamera.GetPosition());
}

// 0x4ABF50
Expand Down
6 changes: 6 additions & 0 deletions source/game_sa/Weather.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ class CWeather {
static void SetWeatherToAppropriateTypeNow();
static void Update();
static void UpdateInTunnelness();
/*!
* @notsa
* @detail Based on code @ `0x72A640`
* @return The corresponding weather region at a given 2D position, or `WEATHER_REGION_DEFAULT` if no specific region was found
*/
static eWeatherRegion FindWeatherRegion(CVector2D pos);
static void UpdateWeatherRegion(CVector* posn);
static bool IsRainy();

Expand Down
4 changes: 4 additions & 0 deletions source/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ project "gta_sa_modern"
"../libs/tracy/public",
"../libs/json/include"
}

filter "options:script-tracing"
defines { "NOTSA_SCRIPT_TRACING" }
filter {}

defines {
"NOMINMAX",
Expand Down

0 comments on commit 718bdb6

Please sign in to comment.