File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ some buffer overflows have been fixed.
4444| Alt+(Keypad) Plus | Increase window size |
4545| Alt+(Keypad) Minus | Decrease window size |
4646| Alt+R | Reset window if stretched |
47+ | Alt+A | Toggle 4:3 aspect ratio |
4748
4849## Build
4950
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ implementation
2828 xRes = 320 ;
2929 yRes = 200 ;
3030 targetFrames = 70 ;
31- aspect : real = xRes / yRes;
31+ aspectRes : real = xRes / yRes;
3232
3333 var windowMultiplier: integer;
3434 window: PSDL_Window;
@@ -41,6 +41,7 @@ implementation
4141
4242 windowResized: boolean;
4343 fullScreen: boolean;
44+ aspect: real;
4445
4546 timer: TSDL_TimerID;
4647 frameCount, lastFrameCount, subFrameCount, lastFrameTick: LongInt;
9293
9394procedure ResetWindowSize ;
9495begin
95- SDL_SetWindowSize(window, xRes * windowMultiplier, yRes * windowMultiplier);
96+ SDL_SetWindowSize(window, xRes * windowMultiplier, Round( yRes * windowMultiplier * aspectRes / aspect) );
9697 windowResized := true;
9798end ;
9899
104105procedure Init ;
105106begin
106107 windowMultiplier := 2 ;
108+ aspect := aspectRes;
107109
108110 if SDL_Init( SDL_INIT_VIDEO or SDL_INIT_TIMER ) < 0 then HALT;
109111
@@ -335,6 +337,15 @@ begin
335337 exit
336338 end ;
337339 end ;
340+ SDL_SCANCODE_A :
341+ begin
342+ if (aspect <> aspectRes) then
343+ aspect := aspectRes
344+ else
345+ aspect := 4 / 3 ;
346+ ResetWindowSize;
347+ exit;
348+ end ;
338349 end ;
339350 end ;
340351
Original file line number Diff line number Diff line change @@ -5704,6 +5704,7 @@ begin
57045704 writeln(' * Alt+(Keypad) Plus : Increase window size' );
57055705 writeln(' * Alt+(Keypad) Minus : Decrease window size' );
57065706 writeln(' * Alt+R : Reset window if stretched' );
5707+ writeln(' * Alt+A : Toggle 4:3 aspect ratio' );
57075708 writeln(' ' );
57085709 writeln(' -------' );
57095710 writeln(' ' );
You can’t perform that action at this time.
0 commit comments