diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 92ddacc7..1a7798fe 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,8 +4,9 @@ Dash Faction Changelog Version 1.9.2 (not released yet) -------------------------------- [@is-this-c](https://github.com/is-this-c) +- Set `rf::gr::text_2d_mode` to ignore fog - Fix `gr_d3d_bitmap`, so `gr_d3d_set_state` is called earlier -- Fix a potential crash after a client quits a game if Directd3D 11 is enabled +- Fix a potential crash, after a client quits a game, if Directd3D 11 is enabled - Improve compatibility with Alpine Faction servers - Fix `PgUp`, `PgDown`, `End`, and `Home` on numeric keypads diff --git a/game_patch/graphics/gr.cpp b/game_patch/graphics/gr.cpp index 49c49067..5ce721e7 100644 --- a/game_patch/graphics/gr.cpp +++ b/game_patch/graphics/gr.cpp @@ -330,4 +330,7 @@ void gr_apply_patch() windowed_cmd.register_cmd(); nearest_texture_filtering_cmd.register_cmd(); lod_distance_scale_cmd.register_cmd(); + + // Fix `rf::gr::text_2d_mode`. + AsmWriter{0x0050BB40}.push(static_cast(rf::gr::FOG_NOT_ALLOWED)); } diff --git a/game_patch/rf/gr/gr.h b/game_patch/rf/gr/gr.h index 76dbd3d9..382e7ce7 100644 --- a/game_patch/rf/gr/gr.h +++ b/game_patch/rf/gr/gr.h @@ -52,8 +52,7 @@ namespace rf::gr }; static_assert(sizeof(Vertex) == 0x30); - enum TextureSource - { + enum TextureSource { TEXTURE_SOURCE_NONE = 0x0, TEXTURE_SOURCE_WRAP = 0x1, TEXTURE_SOURCE_CLAMP = 0x2, @@ -68,8 +67,7 @@ namespace rf::gr TEXTURE_SOURCE_MT_CLAMP_TRILIN = 0xB, }; - enum ColorSource - { + enum ColorSource { COLOR_SOURCE_VERTEX = 0x0, COLOR_SOURCE_TEXTURE = 0x1, COLOR_SOURCE_VERTEX_TIMES_TEXTURE = 0x2, @@ -77,16 +75,14 @@ namespace rf::gr COLOR_SOURCE_VERTEX_TIMES_TEXTURE_2X = 0x4, }; - enum AlphaSource - { + enum AlphaSource { ALPHA_SOURCE_VERTEX = 0x0, ALPHA_SOURCE_VERTEX_NONDARKENING = 0x1, ALPHA_SOURCE_TEXTURE = 0x2, ALPHA_SOURCE_VERTEX_TIMES_TEXTURE = 0x3, }; - enum AlphaBlend - { + enum AlphaBlend { ALPHA_BLEND_NONE = 0x0, ALPHA_BLEND_ADDITIVE = 0x1, ALPHA_BLEND_ALPHA_ADDITIVE = 0x2, @@ -97,8 +93,7 @@ namespace rf::gr ALPHA_BLEND_SWAPPED_SRC_DEST_COLOR = 0x7, }; - enum ZbufferType - { + enum ZbufferType { ZBUFFER_TYPE_NONE = 0x0, ZBUFFER_TYPE_READ = 0x1, ZBUFFER_TYPE_READ_EQUAL = 0x2, @@ -107,8 +102,7 @@ namespace rf::gr ZBUFFER_TYPE_FULL_ALPHA_TEST = 0x5, }; - enum FogType - { + enum FogType { FOG_ALLOWED = 0x0, FOG_ALLOWED_ADD2 = 0x1, FOG_ALLOWED_MULT2 = 0x2,