Browse Source

Got Windows working

I have no clue how Windows still fucked with my newlines.
master
Macoy Madson 5 months ago
parent
commit
8dd2a593ba
  1. 2
      Dependencies/gamelib
  2. 23
      src/Presentation.cake
  3. 20
      src/PresentationWinMain.cpp

2
Dependencies/gamelib

@ -1 +1 @@
Subproject commit fdb50fecaad1c89b8915928c2de9503c9ed9ad79
Subproject commit 0aa40a6cb5ad84be9153bbdade3837564c3e1de9

23
src/Presentation.cake

@ -308,12 +308,14 @@
(cond
((= state read-state-looking-for-keyword)
(when (and (!= ' ' (deref current-char))
(!= '\n' (deref current-char)))
(!= '\n' (deref current-char))
(!= '\r' (deref current-char)))
(var argument-end (* (const char)) null)
(each-char-in-string-const current-char end-char
(set argument-end end-char)
(when (or (= ' ' (deref end-char))
(= '\n' (deref end-char)))
(= '\n' (deref end-char))
(= '\r' (deref end-char)))
(break)))
;; The very last character of the string needs a special case to pull it in
(unless (at 1 argument-end)
@ -335,12 +337,14 @@
(set current-char argument-end)))
((= state read-state-reading-arguments)
(when (and (!= ' ' (deref current-char))
(!= '\n' (deref current-char)))
(!= '\n' (deref current-char))
(!= '\r' (deref current-char)))
(var argument-end (* (const char)) null)
(each-char-in-string-const current-char end-char
(set argument-end end-char)
(when (or (= ' ' (deref end-char))
(= '\n' (deref end-char)))
(= '\n' (deref end-char))
(= '\r' (deref end-char)))
(break)))
;; The very last character of the string needs a special case to pull it in
(unless (at 1 argument-end)
@ -793,6 +797,8 @@
(each-char-in-string-const str current-char
(cond
((= (deref current-char) '\r')
(continue))
((= (deref current-char) '\n')
(set write-y (+ line-height write-y))
(set write-x x)
@ -890,7 +896,15 @@
effect-id-fireball
effect-id-power-0)
(comptime-cond
('Windows
(c-import "<windows.h>")
(add-static-link-objects "User32.lib")))
(defun main (&return int)
(comptime-cond
('Windows
(SetProcessDpiAwarenessContext DPI_AWARENESS_CONTEXT_SYSTEM_AWARE)))
(data-bundle-load-all-resources)
(var device-dpi (unsigned char) 144)
@ -1303,6 +1317,7 @@
(comptime-cond
('Windows
(add-c-build-dependency "PresentationWinMain.cpp")
(set-cakelisp-option executable-output "Presentation.exe"))
(true
(set-cakelisp-option executable-output "presentation")))

20
src/PresentationWinMain.cpp

@ -0,0 +1,20 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifdef __cplusplus
extern "C"
#endif
int main();
#ifdef __cplusplus
extern "C"
#endif
void waitForDebugger();
#ifdef __cplusplus
extern "C"
#endif
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
{
return main();
}
Loading…
Cancel
Save