Skip to content

Instantly share code, notes, and snippets.

@fabd
Last active June 13, 2023 22:03
Show Gist options
  • Save fabd/085dced17dd88c4038ee to your computer and use it in GitHub Desktop.
Save fabd/085dced17dd88c4038ee to your computer and use it in GitHub Desktop.
A script I use to center the game window and play at exactly 2x the original resolution to avoid stretching and blurry image.

#Glide Wut ?

After much testing here is what I found:

  • Glide Wrapper upscales graphics so you can have sharper graphics in FULLSCREEN mode.
  • If you play in windowed mode like I do, and resize the window to exactly 1600x1200 (2x) then Glide wrapper's "super sampling" DOES NOTHING. It keeps the graphics sharp, yes, but so does Autohotkey by simply resizing the window when the game runs in software mode.
  • Unfortunately Glide does not upscale 4x, so at 1600x1200 (2x), there is no smoothing, just the sharp pixellated aspect.

TLDR

  • Glide wrapper is only useful for fullscreen, or if you'd like to use Perspective Mode in windowed.
  • In windowed mode, Glide wrapper can enable coloured lighting but it is very hard to see a difference in vanilla Diablo 2

My setup:

  • Diablo II shortcut icon: -sndbkg -w (-skiptobnet if playing on BattleNet)
  • Use the Autohotkey script to get super crisp graphics at 1600x1200
  • Don't need Glide Wrapper
  • Don't set compatiblity mode in Windows 7 x64

It is actually slightly better than Glide wrapper, because with Glide, the window keeps changing size and also it does some weird glitch in the top left of the desktop. With Autohotkey window resize, there is no glitch, and once you use the hotkey to resize the window, it stays that way until you close the game. It also removes the ugly window frame. AND it doesn't switch off Aero when I run the game.

; Diablo II LoD
;
; Instructions:
;
; 1) Start the game in windowed mode (eg. "-sndbkg -skiptobnet -w" options in shortcut).
;
; 2) Press Ctrl Alt f , Ctrl Alt h to set game to 1600x1200 centered on the desktop.
;
;
; Ctrl Alt f Toggle active window title bar.
; Ctrl Alt g Toggle active window borders.
;
; Ctrl Alt h Center Diablo II window and stretch it to exactly 2x size (1600x1200)
; (first remove edges with Ctrl Alt f)
;
; Ctrl Alt b Move and resize current application window (eg. browser), so that it
; fits within the region of the Diablo II window, so when you alt tab
; back and forth to the game there is no distracting window overlap.
;
; Ctrl Alt e Click Twitch chat popout window then use this to move it to top
; right of screen and size for OBS capture.
;
; Ctrl Alt p Type the /nopickup option in-game
;
;
; For a fullscreen windowed game (eg. KingsBounty) : j g k f
;
; Ctrl Alt j Move Twitch Chat Popout
; Ctrl Alt k Enable transparency
;
;
#InstallKeybdHook
#Persistent
#SingleInstance force
;GameWindow = ahk_class Diablo II
; actual window 806 626
w = 1600
h = 1200
;#IfWinActive, Diablo II
;Move Twitch Chat Popout to top right of desktop (+ size for OBS Capture)
$^!e::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
;WinSet, Style, ^0xC00000 ; toggle title bar
;WinMove, , , 2100, -33, 410, 823
WinMove, , , (A_ScreenWidth - 460), -33, 410, 660
}
return
;Toggles Always On Top and Transparency
$^!j::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinMove, , , 2210, 600, 350, 660
}
return
$^!k::
Winset, Alwaysontop, On, A
WinSet, Transparent, 200, A
return
;$^!+p::
; Winset, Alwaysontop, Off, A
; WinSet, Transparent, 255, A
; return
; Quickly enable "nopickup"
$^!p::
Send {Enter}/nopickup{Enter}
return
;Toggle Title bar
$^!f::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinSet, Style, ^0xC00000 ; toggle title bar
WinSet, AlwaysOnTop, Off
}
return
;Toggle Window border
$^!g::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinSet, Style, ^0x800000 ; toggle thin-line border
WinSet, Style, ^0x400000 ; toggle dialog frame
WinSet, Style, ^0x40000 ; toggle thickframe/sizebox
WinSet, Style, -0xC00000 ; hide title bar
}
return
;Centered 1600x1200 window
$^!h::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinMove, , , (A_ScreenWidth - 1600)/2, (A_ScreenHeight - 1200)/2 - 24, 1600, 1200
}
return
;Center and size other application windows so they fit under the game window when Alt-tabbing.
$^!b::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinMove, , , 614, 96, 1334, 1200 ;Set the window size you want
}
return
@Ning0627
Copy link

Ning0627 commented Apr 1, 2022

640 480 is a good idea

Busy working time has come to me since this month
I think I would have no time for gaming in a long time
thank you so much sir!
you have fun and happiness!
god bless you!❤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment