Map: zoomed-view symbols centred, 10x reveal and enemy range; progress screen on the menu background
- Megamap / TAB map zoomed view: heroes' markers and the other symbols (integer 200h centre immediates) follow the view's centre. - Map reveal: the hero's reveal stamp scaled 10x (mods/mapreveal.cpp, docs/map-reveal.md); creatures on the zoomed map shown within 10x the sight range. - Load / save progress screen drawn on the rock background across the full width, the picture blended over it (mods/loadingscreen.cpp); the classic 1024x768 frame is gone. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3f03228c29
commit
b452558122
18 files changed
+435
-40
No files matched your search
+11
-11
@@ -24,6 +24,7 @@
|
||||
#include "mods/widescreen.h"
|
||||
|
||||
#include "mods/hud.h"
|
||||
#include "mods/loadingscreen.h"
|
||||
#include "mods/megamap.h"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -63,9 +64,9 @@ bool g_pushesPatched = false;
|
||||
int g_renderWidth = 0;
|
||||
int g_renderHeight = 0;
|
||||
|
||||
// The loading screen is laid out for 1024x768 ("classic"); the main menu
|
||||
// thread renders the full width too (its windows drawn centred by
|
||||
// mods/screen.cpp), the in-game view is widened.
|
||||
// Every frame uses the full render width: the main menu thread (its windows
|
||||
// drawn centred by mods/screen.cpp), the loading screen (centred on the menu
|
||||
// background, mods/loadingscreen.cpp), the widened in-game view.
|
||||
std::atomic<DWORD> g_menuThread = 0;
|
||||
// Whether the most recent scene (on any thread) was the main menu's or the
|
||||
// loading screen's. UI input is processed outside the menu thread.
|
||||
@@ -343,7 +344,7 @@ bool MenuIsShowing() {
|
||||
return g_lastSceneMenu;
|
||||
}
|
||||
|
||||
bool IsClassicFrame() {
|
||||
bool IsLoadingScreen() {
|
||||
return g_renderWidth != 0 && g_loadingScreenDepth > 0;
|
||||
}
|
||||
|
||||
@@ -369,22 +370,21 @@ void __fastcall UiManager_ThreadLoop(void* self, void* edx) {
|
||||
|
||||
void __fastcall DxDriver7_LoadingScreen(DxDriver7* self, void* edx, uint32_t progress, const char* text) {
|
||||
++g_loadingScreenDepth;
|
||||
mods::loadingscreen::Begin(self);
|
||||
DxDriver7_LoadingScreen_original(self, edx, progress, text);
|
||||
mods::loadingscreen::End();
|
||||
--g_loadingScreenDepth;
|
||||
}
|
||||
|
||||
// The loading screen draws for a 1024x768 screen: give it a 1024x768
|
||||
// viewport (the borderless mod then presents just that area, scaled), and
|
||||
// everything else the full render size.
|
||||
// Every frame gets the full render size as its viewport.
|
||||
int __fastcall DxDriver7_BeginScene(DxDriver7* self, void* edx) {
|
||||
mods::hud::OnDevice(self->device);
|
||||
if (self->sceneDepth == 0) {
|
||||
g_lastSceneMenu = IsClassicFrame() || IsMenuThread();
|
||||
g_lastSceneMenu = IsLoadingScreen() || IsMenuThread();
|
||||
}
|
||||
if (g_renderWidth != 0 && self->sceneDepth == 0 && self->device) {
|
||||
const bool classic = IsClassicFrame();
|
||||
Viewport7 viewport = {0, 0, classic ? 1024u : static_cast<DWORD>(g_renderWidth),
|
||||
classic ? 768u : static_cast<DWORD>(g_renderHeight), 0.0f, 1.0f};
|
||||
Viewport7 viewport = {0, 0, static_cast<DWORD>(g_renderWidth), static_cast<DWORD>(g_renderHeight), 0.0f,
|
||||
1.0f};
|
||||
using SetViewportFn = HRESULT(__stdcall*)(void* device, Viewport7* viewport);
|
||||
auto setViewport = reinterpret_cast<SetViewportFn>((*static_cast<void***>(self->device))[13]);
|
||||
setViewport(self->device, &viewport);
|
||||
|
||||
Reference in new issue
Block a user