Skip to content

Commit ac60a07

Browse files
committed
Add "frameless" window option in cfg file, for hiding the window frame.
1 parent 25e852c commit ac60a07

5 files changed

Lines changed: 22 additions & 4 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
D2DX is a Glide-wrapper and mod that makes the classic Diablo II/LoD run well on modern PCs, while honoring the original look and feel of the game.
44
Play in a window or in fullscreen, glitch-free, with or without enhancements like widescreen, true high framerate and anti-aliasing.
55

6-
Version 0.99.512
6+
Version 0.99.512c
77

88
## Features
99
- Turns the game into a well behaved DirectX 11 title on Windows 10 (also 7, 8 and 8.1).
@@ -79,9 +79,12 @@ D2DX uses the following third party libraries:
7979

8080
## Recent release history
8181

82-
### 0.99.512
82+
### 0.99.512c
83+
- Add "frameless" window option in cfg file, for hiding the window frame.
8384
- Fix corrupt graphics in low lighting detail mode.
8485
- Fix corrupt graphics in perspective mode.
86+
- Fix distorted automap cross.
87+
- Fix mouse sometimes getting stuck on the edge of the screen when setting a custom resolution in the cfg file.
8588

8689
### 0.99.511
8790
- Change resolution mod from D2HD to the newer SGD2FreeRes (both by Mir Drualga).

d2dx-defaults.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
#
77

88
[window]
9-
scale=1 # range 1-3, an integer scale factor for the window (in windowed mode)
9+
scale=1 # range 1-3, an integer scale factor for the window
1010
position=[-1,-1] # if [-1,-1] the window will be centered, otherwise placed at the explicit position given here
11+
frameless=false # if true, the window frame (caption bar etc) will be removed
1112

1213
[game]
1314
size=[-1,-1] # if [-1,-1] d2dx will decide a suitable game size, otherwise will use the size given here

src/d2dx/Options.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ void Options::ApplyCfg(
120120
SetWindowPosition({ (int32_t)x.u.i, (int32_t)y.u.i });
121121
}
122122
}
123+
124+
auto frameless = toml_bool_in(window, "frameless");
125+
if (frameless.ok)
126+
{
127+
SetFlag(OptionsFlag::Frameless, frameless.u.b);
128+
}
123129
}
124130

125131
auto debug = toml_table_in(root, "debug");

src/d2dx/Options.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ namespace d2dx
3838

3939
TestMotionPrediction,
4040

41+
Frameless,
42+
4143
Count
4244
};
4345

src/d2dx/RenderContext.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,13 @@ void RenderContext::AdjustWindowPlacement(
819819
const int32_t oldWindowCenterX = (oldWindowRect.left + oldWindowRect.right) / 2;
820820
const int32_t oldWindowCenterY = (oldWindowRect.top + oldWindowRect.bottom) / 2;
821821

822-
const DWORD windowStyle = WS_VISIBLE | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU;
822+
DWORD windowStyle = WS_VISIBLE;
823+
824+
if (!_d2dxContext->GetOptions().GetFlag(OptionsFlag::Frameless))
825+
{
826+
windowStyle |= WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU;
827+
}
828+
823829
RECT windowRect = { 0, 0, _windowSize.width, _windowSize.height };
824830
AdjustWindowRect(&windowRect, windowStyle, FALSE);
825831
const int32_t newWindowWidth = windowRect.right - windowRect.left;

0 commit comments

Comments
 (0)