Compare commits

...

197 Commits

Author SHA1 Message Date
elasota
69e3fb3023 Handle Quit event more gracefully 2020-04-18 05:51:39 -04:00
elasota
94f26d0be1 Redraw grease on room lighting change. Fixes regression where grease would not be visible after turning lights on. 2020-04-18 05:23:40 -04:00
elasota
d893b356f1 Fix dynamic indexes desynchronizing on resolution change (fixes Slumberland boombox switch not working if you change resolution on the screen with the switch) 2020-04-18 00:42:45 -04:00
elasota
c3f3fb4621 Override alt-enter behavior, use borderless fullscreen instead of exclusive fullscreen. This should fix the game breaking when bringing up the open file dialog in fullscreen.
(Note that this doesn't handle resolution changes yet)
2020-04-18 00:18:20 -04:00
elasota
0335dd7786 Fix alt-enter 2020-04-06 03:34:31 -04:00
elasota
ffd9d9cc1f Keep level editor windows in screen bounds 2020-04-05 22:31:22 -04:00
elasota
f46ae55d62 Merge branch 'resizable' 2020-04-05 18:38:05 -04:00
elasota
5c1aacc268 Fix memory corruption on victory screen 2020-04-05 18:36:27 -04:00
elasota
d7353ff6ed Refactor neighboring rooms sync-ups. Remove all of the neighboring room objects and recreate them, which fixes a bunch of problems with objects becoming out-of-frame after resize. 2020-04-05 18:34:37 -04:00
elasota
b827048c36 Account for chrome padding and menu bar when auto-relocating windows 2020-04-05 18:30:04 -04:00
elasota
f56d879d12 Fix mirrors on resize 2020-04-05 04:51:58 -04:00
elasota
1269294d28 Center windows when over max resolution 2020-04-05 02:15:49 -04:00
elasota
643bc7b761 Remove scoreboard vertical offset (which doesn't work) 2020-04-05 01:51:42 -04:00
elasota
2f663646f5 Remove unused menu bar window 2020-04-05 00:35:01 -04:00
elasota
f4a57dba6e Redraw scoreboard on splash screen res change 2020-04-05 00:32:13 -04:00
elasota
7404c60a96 Disable Alt-Enter 2020-04-05 00:31:55 -04:00
elasota
805638f2c9 Fix TV and splash on res change 2020-04-04 18:50:45 -04:00
elasota
59e9a9480e Fix high score background drawing white after a win 2020-04-04 17:49:45 -04:00
elasota
49d1d6124a Fix off-center high score screen at high resolutions 2020-04-04 17:46:38 -04:00
elasota
129396ef53 Fix more dynamics, fix end screen stars with large vertical resolutions 2020-04-04 17:46:19 -04:00
elasota
1cdd372e35 Fix up most other appliances and enemies on res change 2020-04-02 20:44:24 -04:00
elasota
9a4f3f0e67 Fix candle flames and grease spill progression on res change 2020-04-02 01:47:25 -04:00
elasota
db89bf178c Fix grease on res change 2020-04-01 23:35:10 -04:00
elasota
793822fbb4 EOL fixes 2020-04-01 23:34:55 -04:00
elasota
66a709ad2a Fix memory corruption 2020-04-01 23:29:48 -04:00
elasota
6326a0b2d9 Partial resolution change support 2020-04-01 14:53:44 -04:00
elasota
e114d5c5dd Clean out unused API 2020-03-14 12:03:50 -04:00
elasota
cea0bde015 API cleanup, fix some lingering InvalWindowRects 2020-03-14 06:38:46 -04:00
elasota
3d37ded31d Button highlight behavior 2020-03-14 05:04:51 -04:00
elasota
3dcc787ca0 Add menu hints and checks 2020-03-14 05:04:01 -04:00
elasota
d394975336 Finish scroll bars 2020-03-14 04:29:47 -04:00
elasota
dd78b08a5f Fix WaitForEvent having an extra delay tick 2020-03-14 04:29:36 -04:00
elasota
088640b544 Replace "QT" tag with "TV" 2020-03-14 03:21:45 -04:00
elasota
d6d4aadeff Update docs 2020-03-14 03:21:30 -04:00
elasota
d90ea24405 Add support for GPA patching, remove some unusable video options 2020-03-14 03:21:20 -04:00
elasota
505e73e842 Restore converted CD Demo House movie 2020-03-14 00:00:54 -04:00
elasota
26bf033465 Fix crash if a movie fails to load 2020-03-14 00:00:38 -04:00
elasota
ed7f8783c0 Partial scroll bar implementation 2020-03-10 01:35:42 -04:00
elasota
699c3cf13c Selection drag support 2020-03-09 01:40:47 -04:00
elasota
424a09ccc8 Fix missing returns 2020-03-09 01:40:34 -04:00
elasota
e0fb300766 Return first res by ID, not by name 2020-03-09 01:40:26 -04:00
elasota
46f7a7cc69 More editbox functionality 2020-03-08 23:14:53 -04:00
elasota
e93b035d5c Fix bad window centering 2020-03-08 23:14:27 -04:00
elasota
f4929613aa Remove some debug checks 2020-03-01 23:37:28 -05:00
elasota
7b27d6c6b5 Most remaining level editor work 2020-03-01 17:01:35 -05:00
elasota
abd4f1a978 Menu separator support 2020-02-27 01:22:49 -05:00
elasota
5567250e14 Fix dialog label constraint not working 2020-02-27 01:22:38 -05:00
elasota
4efb44ddae Fix "House" menu title being overwritten 2020-02-26 22:27:07 -05:00
elasota
f1d7e1f52f Fix constant IDs, remove ZoomWindow 2020-02-26 12:26:19 -05:00
elasota
cc17911776 Fix up some level editor dialog behavior 2020-02-26 12:17:04 -05:00
elasota
d617795591 Level editor work 2020-02-25 23:09:09 -05:00
elasota
c78a20dafd Level editor work 2020-02-23 20:21:04 -05:00
elasota
d63ac98624 Update acknowledgments to include FreeType 2020-02-21 11:44:29 -05:00
elasota
36f10c60b4 Get TVs working 2020-02-20 03:13:15 -05:00
elasota
fcd8fdb17e Fix broken BMP decode 2020-02-20 01:30:25 -05:00
elasota
505941a9e4 Fixed alert substitutions not working 2020-02-20 01:30:09 -05:00
elasota
d5f3595350 Remove Roboto font 2020-02-19 23:43:42 -05:00
elasota
46fc16c97e Convert QuickTime movies to image sequences 2020-02-19 23:39:05 -05:00
elasota
9daee7af4e More editor progress 2020-02-18 20:53:54 -05:00
elasota
42826a5d58 Add flattenmov tool 2020-02-18 20:53:40 -05:00
elasota
fd5e3af4a3 Disclaimer 2020-02-18 20:53:18 -05:00
elasota
884237d0c6 Split off documentation 2020-02-16 22:17:58 -05:00
elasota
7548690c51 Fix up radio buttons, more editbox functionality.
All blocking issues with UI should now be fixed.
2020-02-16 21:57:02 -05:00
elasota
a726a88f70 Remove x86 target 2020-02-16 21:55:53 -05:00
elasota
79a7fee0a7 Add RapidJSON to acknowledgments 2020-02-16 21:55:23 -05:00
elasota
f70344aac0 Remove jsonchecker (license cleanup) 2020-02-16 21:52:53 -05:00
elasota
8f4ac13919 Partial editbox support for high scores 2020-02-16 20:55:47 -05:00
elasota
bd2e27978e Use older XInput 2020-02-16 20:55:14 -05:00
elasota
a58b73aeb4 Remove GetCurrentThreadStackLimits call (for Win7 support) 2020-02-08 03:19:48 -05:00
elasota
57d0678090 Transcode special chars via UTF-8 2020-02-07 22:08:52 -05:00
elasota
7c3dc7d1a3 Convert DITLs to JSON 2020-02-07 02:45:45 -05:00
elasota
507019abda Redraw editbox when text changes 2020-02-07 02:44:13 -05:00
elasota
1fe1c7e24e EOL fixes 2020-02-07 02:43:51 -05:00
elasota
7b8052174f Fix high score banner entry 2020-02-05 00:22:55 -05:00
elasota
60e0912a7b Disable room editor 2020-02-05 00:22:39 -05:00
elasota
4f24439f7e Finish implementing alerts 2020-02-04 23:32:40 -05:00
elasota
dee560492e Edit box baseline (regresses volume control dialog though) 2020-02-03 04:54:55 -05:00
elasota
25ee3531b2 EOL fixes 2020-02-03 01:18:16 -05:00
elasota
aa8043fafc Remove unused directory 2020-02-03 01:18:07 -05:00
elasota
82ed7f7193 Mark houses read-only 2020-02-02 18:06:19 -05:00
elasota
0c3693f6cc Fix file lock check 2020-02-02 17:46:37 -05:00
elasota
1d54de0eb9 Fix high score display 2020-02-02 17:43:11 -05:00
elasota
fdc56da111 Fix text wrap not measuring whitespace 2020-02-02 02:53:59 -05:00
elasota
265db139c8 Various improvements toward getting high scores working again. 2020-02-02 01:38:38 -05:00
elasota
7cb6994f90 Import indexed strings as text files 2020-01-24 02:41:42 -05:00
elasota
9e9a79c4b7 Alert skeleton 2020-01-24 02:09:19 -05:00
elasota
928efdd527 Switch timestamp format to combined UTC + local so fewer stupid hacks are required. 2020-01-23 22:36:12 -05:00
elasota
6171b1185e Don't destroy menus on removal 2020-01-23 22:35:39 -05:00
elasota
fd48ca0a62 Fix crash when a PICT has no bounds resource 2020-01-23 22:27:51 -05:00
elasota
556a395e4a EOL fix 2020-01-23 22:27:18 -05:00
elasota
b20e1876e3 Do TZ conversion in GPA conversion, keep timestamps in UTC. This makes ZIP conversion inconsistent across TZs, but less hacky everywhere else. Pending addition of a tool to just dump a combined timestamp. 2020-01-23 03:45:36 -05:00
elasota
38d172aa49 Remove Infinity Windoid 2020-01-23 03:43:15 -05:00
elasota
a1475d2ee3 Fixed a bunch of improper timestamp handling, made ZIP timestamping deterministic, added default timestamp 2020-01-23 02:47:31 -05:00
elasota
a73d6fe10d Fix missing return 2020-01-23 02:24:56 -05:00
elasota
909533930e Fix broken timestamp serialization 2020-01-23 01:39:27 -05:00
elasota
ccbb8015d5 Change clear color to dark blue 2020-01-23 01:29:54 -05:00
elasota
5a3cedaa95 Level editor and resource loader fixups and refactors 2020-01-23 01:19:12 -05:00
elasota
27a1f89c15 Implicit divide by 4 in ellipse plotter, disable debug asserts by default 2020-01-22 01:48:02 -05:00
elasota
06243e4d45 Fix potential off-by-one 2020-01-21 00:21:11 -05:00
elasota
5e3e666765 Fix ellipse plotter, adhere to sounder invariants this time. 2020-01-21 00:09:38 -05:00
elasota
f5b0ef3698 Revert "Fix some problematic ellipse plotter cases (like 4x36)"
This reverts commit 1d7a75c8a9.
2020-01-20 23:59:45 -05:00
elasota
c112738f2e Remove glue drivers, use Gp drivers instead 2020-01-20 05:14:50 -05:00
elasota
1d7a75c8a9 Fix some problematic ellipse plotter cases (like 4x36) 2020-01-20 05:00:44 -05:00
elasota
610c72b9bb Fix the rest of house load and game over asserts 2020-01-20 02:17:07 -05:00
elasota
c9f3e5aba6 EOL fixes 2020-01-20 02:16:34 -05:00
elasota
e5932eef3b Add porting notes 2020-01-20 02:16:14 -05:00
elasota
156e58e59f Disable Mac Plus hacks 2020-01-20 02:13:23 -05:00
elasota
f3fa442d0f Updated font acknowledgments 2020-01-19 19:27:45 -05:00
elasota
3b11a457a3 Fix audio queue consume overrun (caused shutdown crash due to multiple buffers being queued) 2020-01-19 19:25:36 -05:00
elasota
1b5720c118 Adjust text AA to be more gamma-correct. Switch everything to Open Sans. 2020-01-19 07:36:44 -05:00
elasota
93b4554961 Migrate image storage from PICT to BMP 2020-01-18 21:15:31 -05:00
elasota
69ef542969 Fix audio shutdown crashes 2020-01-18 18:39:54 -05:00
elasota
c79ddd0d35 Add text anti-aliasing, disable arcade mode 2020-01-18 18:20:16 -05:00
elasota
d8331eaeb7 Switch to zip archive format for resource data, prep work for moving from PICT/snd to BMP/WAV 2020-01-18 08:37:57 -05:00
elasota
e01cd4ef2e Merge branch 'master' of https://github.com/elasota/GlidePort 2020-01-05 23:27:33 -05:00
elasota
d9d3a7592a Move Glider PRO data from GpApp2 to GliderProData 2020-01-05 23:27:27 -05:00
Eric Lasota
b807717ca7 Update ACKNOWLEDGMENTS.txt 2020-01-05 23:16:56 -05:00
elasota
2e97e44e92 Added release script 2020-01-05 18:07:34 -05:00
elasota
645a997c7a Refactoring 2020-01-05 16:41:04 -05:00
elasota
1fba6f9e85 Refactor color cursor loading 2020-01-05 04:13:00 -05:00
elasota
700c31b9e4 Remove unused functions 2020-01-05 04:02:36 -05:00
elasota
7c4ec4a467 Replace MacRoman conversion with LIBICONV implementation 2020-01-05 04:02:19 -05:00
elasota
1e3cf76bf3 Remove notes 2020-01-05 02:57:57 -05:00
elasota
cb41ae9740 Update license text 2020-01-05 02:56:27 -05:00
elasota
ef00777b31 Merge branch 'master' of https://github.com/elasota/GlidePort 2020-01-05 02:33:58 -05:00
elasota
aca18df74b More stuff, fix saved games 2020-01-05 02:33:03 -05:00
elasota
a4b8db1065 Level editor work 2020-01-04 01:19:01 -05:00
Eric Lasota
56cd071798 Update README.txt 2020-01-03 00:31:49 -05:00
Eric Lasota
d37143eec1 Update README.txt 2020-01-03 00:31:30 -05:00
elasota
ec7e511cdd Rename projects to Aerofoil 2020-01-03 00:30:09 -05:00
elasota
3642f0c045 Rename to Aerofoil 2020-01-03 00:17:45 -05:00
elasota
32116bc17e Fix up some file handling, add support for initializing a house file 2020-01-03 00:13:41 -05:00
elasota
e00f506ee2 Fix MiniRez crash on empty res files 2020-01-03 00:13:21 -05:00
elasota
1da2851d3a Scaled blit, plus fix some level editor things 2020-01-02 01:32:00 -05:00
elasota
1c6ab800a7 Refactor some dialog handling, enforce proper port disposal 2020-01-01 20:49:18 -05:00
elasota
5fe6218c28 Add some initial widget functionality (prefs partly working) 2020-01-01 20:24:46 -05:00
elasota
d9b5dd20d6 Refactoring, clean up shutdown path 2019-12-31 05:20:07 -05:00
elasota
62438ab4f3 Sound system refactor 2019-12-31 04:49:38 -05:00
elasota
b963aa9b5f Remove unused file 2019-12-31 03:55:56 -05:00
elasota
52338a3983 Event queue refactor 2019-12-31 03:55:17 -05:00
elasota
84e4f9fb0b Refactoring, dialog work 2019-12-31 02:42:20 -05:00
elasota
04a955213c Major draw code refactor 2019-12-30 20:53:11 -05:00
elasota
918578469e Fix low gray color mapping to dark red 2019-12-30 20:52:56 -05:00
elasota
349680840b Fix demo 2019-12-30 01:25:16 -05:00
elasota
fb105bd338 Handle refactor 2019-12-29 23:14:37 -05:00
elasota
9cf539eb52 Refactoring 2019-12-29 22:12:11 -05:00
elasota
dadb21a275 FS refactoring, 64-bit timestamps 2019-12-29 21:31:49 -05:00
elasota
a546b0ce55 Fix room light switches drawing the wrong color (conflicting with Mac Plus censor) 2019-12-29 21:31:28 -05:00
elasota
77441c19fd XInput support 2019-12-29 17:39:19 -05:00
elasota
430842d17b File system refactoring 2019-12-29 06:38:18 -05:00
elasota
b24505164d Remove regions, add framing (fixes mirrors) 2019-12-29 04:13:35 -05:00
elasota
527e83fdd6 Change FrameOval to editor todo 2019-12-29 03:47:27 -05:00
elasota
8530d92062 Add pattern fill for FillScanlineSpan 2019-12-29 03:01:44 -05:00
elasota
9e4f1f64dc Add ellipse plotter and oval drawing 2019-12-29 02:38:41 -05:00
elasota
08fac98637 Fix mirrors, poly draw (WIP), and game over screen. Temp disable high scores. 2019-12-28 19:50:29 -05:00
elasota
d9e61cffac Fix Y-inverted lines not drawing 2019-12-27 23:02:22 -05:00
elasota
9b79eeeb81 Yield to VOS during pause (fixes hang) 2019-12-27 23:02:01 -05:00
elasota
61738e4e7c Adjusted Mac Plus graphic censor, just cover up the brand line for now. 2019-12-27 23:01:42 -05:00
elasota
32fa8928d4 Disable Mac Plus graphic/sound 2019-12-27 18:29:12 -05:00
elasota
59590d2d9d Fix clock hands sometimes not drawing 2019-12-27 18:28:12 -05:00
elasota
8b82ecabef Refactoring. Add line drawing. 2019-12-27 18:05:32 -05:00
elasota
7f8c46ecb2 Match up rects when using mailbox 2019-12-27 14:19:18 -05:00
elasota
b36077965d Demote scaled blit to TODO 2019-12-27 14:18:34 -05:00
elasota
751a60b580 Add StringToNum implementation 2019-12-27 14:18:20 -05:00
elasota
8ca4d17de7 Add debug trace IDs to ports 2019-12-27 14:18:05 -05:00
elasota
88fe873bbe EOL fixes 2019-12-27 14:17:53 -05:00
elasota
3fc9f587d5 Fix ScanlineMaskBuilder being in the wrong filter 2019-12-27 14:17:32 -05:00
elasota
d0d3999bab Change saved games from assert to TODO 2019-12-27 14:17:01 -05:00
elasota
48dda0664e Fix banner text 2019-12-27 14:16:42 -05:00
elasota
7bc647b026 Get scoreboard bar working 2019-12-27 00:30:31 -05:00
elasota
48f01567f7 Fix EOL 2019-12-26 19:41:32 -05:00
elasota
87d112d187 Nudge scoreboard rects to positive coordinates (pending move to a different window) 2019-12-26 19:41:24 -05:00
elasota
97570693da Add NumToString 2019-12-26 19:40:47 -05:00
elasota
843718a6c4 Fix air duct crash 2019-12-26 15:22:40 -05:00
elasota
501f36070a Implement sound stop/flush (stopping boombox no longer asserts) 2019-12-26 13:32:54 -05:00
elasota
b9f1d5222f Fix music mode change thread safety 2019-12-26 13:12:56 -05:00
elasota
c4e93b0ccf Cleanup, add scanline mask builder 2019-12-26 12:58:58 -05:00
elasota
b10dda4a54 Fix paper shredder crash 2019-12-25 22:20:25 -05:00
elasota
ac3929fb1f Keyboard input 2019-12-25 22:20:10 -05:00
elasota
5cb9b85396 Fix house data corruption, progress to first screen 2019-12-24 18:39:30 -05:00
elasota
3111609536 Menu work, move VOS queue interface 2019-12-24 02:35:24 -05:00
elasota
4c743c90b1 Update license 2019-12-23 19:16:45 -05:00
elasota
9aacfdfea7 Updated docs/licenses 2019-12-23 19:15:17 -05:00
elasota
9cab71365d Remove .aps and .res files 2019-12-23 17:48:59 -05:00
elasota
08ca318d50 Reimport icons 2019-12-23 17:47:52 -05:00
elasota
6b2a0226a7 Remove unused files 2019-12-23 17:47:34 -05:00
elasota
7ab4c8960d Add Roboto font, misc icons and text things 2019-12-23 17:43:10 -05:00
elasota
e089cabf98 Update ConvertResources to make the packaged dirs 2019-12-22 00:36:40 -05:00
elasota
eed82e2960 Add mouse cursor handling 2019-12-22 00:35:30 -05:00
elasota
8354d13a84 Add FreeType, progress to title screen 2019-12-21 18:40:17 -05:00
elasota
c9c6976344 Working up to start of menu loading 2019-12-12 23:37:40 -05:00
elasota
f7335a2c8b Add FTagData tool so QuickTime movies use the same FS format as everything else 2019-12-12 23:36:45 -05:00
elasota
e368cf7235 More work. Audio driver works enough to play music now. 2019-12-11 00:51:42 -05:00
elasota
b1e8e11a56 Delete .bin files 2019-11-11 00:16:00 -05:00
elasota
60013308f4 Delete .idb files 2019-11-11 00:14:14 -05:00
elasota
bb73fc6831 Add .idb to gitignore 2019-11-11 00:12:34 -05:00
elasota
c8472f7295 Lots of stuff 2019-11-11 00:11:59 -05:00
1948 changed files with 660206 additions and 840 deletions

10
.editorconfig Normal file
View File

@@ -0,0 +1,10 @@
root=true
[*.{h,c,cpp}]
indent_style=tab
indent_size=4
tab_width=4
end_of_line=lf
charset=latin1
trim_trailing_whitespace=true
insert_final_newline=true

26
.gitignore vendored Normal file
View File

@@ -0,0 +1,26 @@
*.suo
*.db
*.opendb
*.ipch
*.iobj
*.ipdb
*.pch
*.user
*.mcp
*.obj
*.log
*.tlog
*.lastbuildstate
*.dll
*.exe
*.exp
*.ilk
*.lib
*.pdb
*.idb
*.aps
*.res
.vs/*
Packaged/*
DebugData/*
ReleasePkg/*

24
ACKNOWLEDGMENTS.txt Normal file
View File

@@ -0,0 +1,24 @@
Open Sans font:
(c)2011 Google
Distributed under the Apache License (see Resources/Fonts/OpenSans/LICENSE)
stb_image_write:
Created by Sean Barrett
MacRomanConversion uses a table from LIBICONV:
Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
Distributed under the LGPLv2 license (See MacRomanConversion/LICENSE.txt)
RapidJSON:
Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
Distributed under the MIT license (See rapidjson/license.txt)
zlib:
(C) 1995-2017 Jean-loup Gailly and Mark Adler
Distributed under zlib license (See zlib/README)

139
Aerofoil.sln Normal file
View File

@@ -0,0 +1,139 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2020
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hqx2bin", "hqx2bin\hqx2bin.vcxproj", "{45B1B18C-C846-4044-9206-74F58DFC5E88}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PortabilityLayer", "PortabilityLayer\PortabilityLayer.vcxproj", "{6EC62B0F-9353-40A4-A510-3788F1368B33}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MiniRez", "MiniRez\MiniRez.vcxproj", "{2FF15659-5C72-48B8-B55B-3C658E4125B5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GpApp", "GpApp\GpApp.vcxproj", "{6233C3F2-5781-488E-B190-4FA8836F5A77}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hqx2gp", "hqx2gp\hqx2gp.vcxproj", "{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PictChecker", "PictChecker\PictChecker.vcxproj", "{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GpAudioDriver_XAudio2", "GpAudioDriver_XAudio2\GpAudioDriver_XAudio2.vcxproj", "{E3BDC783-8646-433E-ADF0-8B6390D36669}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTagData", "FTagData\FTagData.vcxproj", "{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeType", "FreeType\FreeType.vcxproj", "{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompileShadersD3D11", "CompileShadersD3D11\CompileShadersD3D11.vcxproj", "{ED2F91E1-673A-4590-82B2-EB157927D3E3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConvertColorCursors", "ConvertColorCursors\ConvertColorCursors.vcxproj", "{B852D549-4020-4477-8BFB-E199FF78B047}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GpDisplayDriver_D3D11", "GpDisplayDriver_D3D11\GpDisplayDriver_D3D11.vcxproj", "{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GpInputDriver_XInput", "GpInputDriver_XInput\GpInputDriver_XInput.vcxproj", "{17B96F07-EF92-47CD-95A5-8E6EE38AB564}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Aerofoil", "Aerofoil\Aerofoil.vcxproj", "{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MacRomanConversion", "MacRomanConversion\MacRomanConversion.vcxproj", "{07351A8E-1F79-42C9-BBAB-31F071EAA99E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gpr2gpa", "gpr2gpa\gpr2gpa.vcxproj", "{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcxproj", "{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bin2gp", "bin2gp\bin2gp.vcxproj", "{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MakeTimestamp", "MakeTimestamp\MakeTimestamp.vcxproj", "{9023DF2F-A33D-485A-B13D-0973348B2F9B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flattenmov", "flattenmov\flattenmov.vcxproj", "{89F8D13E-F216-4B67-8DE9-7F842D349E94}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Debug|x64.ActiveCfg = Debug|x64
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Debug|x64.Build.0 = Debug|x64
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Release|x64.ActiveCfg = Release|x64
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Release|x64.Build.0 = Release|x64
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Debug|x64.ActiveCfg = Debug|x64
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Debug|x64.Build.0 = Debug|x64
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Release|x64.ActiveCfg = Release|x64
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Release|x64.Build.0 = Release|x64
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Debug|x64.ActiveCfg = Debug|x64
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Debug|x64.Build.0 = Debug|x64
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Release|x64.ActiveCfg = Release|x64
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Release|x64.Build.0 = Release|x64
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Debug|x64.ActiveCfg = Debug|x64
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Debug|x64.Build.0 = Debug|x64
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Release|x64.ActiveCfg = Release|x64
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Release|x64.Build.0 = Release|x64
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Debug|x64.ActiveCfg = Debug|x64
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Debug|x64.Build.0 = Debug|x64
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Release|x64.ActiveCfg = Release|x64
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Release|x64.Build.0 = Release|x64
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Debug|x64.ActiveCfg = Debug|x64
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Debug|x64.Build.0 = Debug|x64
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Release|x64.ActiveCfg = Release|x64
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Release|x64.Build.0 = Release|x64
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Debug|x64.ActiveCfg = Debug|x64
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Debug|x64.Build.0 = Debug|x64
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Release|x64.ActiveCfg = Release|x64
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Release|x64.Build.0 = Release|x64
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Debug|x64.ActiveCfg = Debug|x64
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Debug|x64.Build.0 = Debug|x64
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Release|x64.ActiveCfg = Release|x64
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Release|x64.Build.0 = Release|x64
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Debug|x64.ActiveCfg = Debug|x64
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Debug|x64.Build.0 = Debug|x64
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Release|x64.ActiveCfg = Release|x64
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Release|x64.Build.0 = Release|x64
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Debug|x64.ActiveCfg = Debug|x64
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Debug|x64.Build.0 = Debug|x64
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Release|x64.ActiveCfg = Release|x64
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Release|x64.Build.0 = Release|x64
{B852D549-4020-4477-8BFB-E199FF78B047}.Debug|x64.ActiveCfg = Debug|x64
{B852D549-4020-4477-8BFB-E199FF78B047}.Debug|x64.Build.0 = Debug|x64
{B852D549-4020-4477-8BFB-E199FF78B047}.Release|x64.ActiveCfg = Release|x64
{B852D549-4020-4477-8BFB-E199FF78B047}.Release|x64.Build.0 = Release|x64
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Debug|x64.ActiveCfg = Debug|x64
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Debug|x64.Build.0 = Debug|x64
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Release|x64.ActiveCfg = Release|x64
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Release|x64.Build.0 = Release|x64
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Debug|x64.ActiveCfg = Debug|x64
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Debug|x64.Build.0 = Debug|x64
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Release|x64.ActiveCfg = Release|x64
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Release|x64.Build.0 = Release|x64
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Debug|x64.ActiveCfg = Debug|x64
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Debug|x64.Build.0 = Debug|x64
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Release|x64.ActiveCfg = Release|x64
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Release|x64.Build.0 = Release|x64
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Debug|x64.ActiveCfg = Debug|x64
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Debug|x64.Build.0 = Debug|x64
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Release|x64.ActiveCfg = Release|x64
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Release|x64.Build.0 = Release|x64
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Debug|x64.ActiveCfg = Debug|x64
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Debug|x64.Build.0 = Debug|x64
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Release|x64.ActiveCfg = Release|x64
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Release|x64.Build.0 = Release|x64
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Debug|x64.ActiveCfg = Debug|x64
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Debug|x64.Build.0 = Debug|x64
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Release|x64.ActiveCfg = Release|x64
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Release|x64.Build.0 = Release|x64
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Debug|x64.ActiveCfg = Debug|x64
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Debug|x64.Build.0 = Debug|x64
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Release|x64.ActiveCfg = Release|x64
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Release|x64.Build.0 = Release|x64
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Debug|x64.ActiveCfg = Debug|x64
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Debug|x64.Build.0 = Debug|x64
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Release|x64.ActiveCfg = Release|x64
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Release|x64.Build.0 = Release|x64
{89F8D13E-F216-4B67-8DE9-7F842D349E94}.Debug|x64.ActiveCfg = Debug|x64
{89F8D13E-F216-4B67-8DE9-7F842D349E94}.Debug|x64.Build.0 = Debug|x64
{89F8D13E-F216-4B67-8DE9-7F842D349E94}.Release|x64.ActiveCfg = Release|x64
{89F8D13E-F216-4B67-8DE9-7F842D349E94}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0D6869A7-07EB-400F-B2AD-48531564555A}
EndGlobalSection
EndGlobal

217
Aerofoil/Aerofoil.filters Normal file
View File

@@ -0,0 +1,217 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="GpMain_Win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpMain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpDisplayDriverFactory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpGlobalConfig.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpAppEnvironment.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpFileSystem_Win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpMemoryBuffer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpPLGlueDisplayDriver.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpFileStream_Win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpSystemServices_Win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpFiberStarter_Win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpFiber_Win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpPLGlueAudioDriver.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpAudioDriverFactory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpPLGlueAudioChannel.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpMutex_Win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpThreadEvent_Win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpFontHandlerFactory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpFontHandler_FreeType2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpVOSEventQueue.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpColorCursor_Win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GpInputDriverFactory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="GpWindows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpDisplayDriverFactory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="IGpDisplayDriver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpMain.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpGlobalConfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpAppEnvironment.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpCoreDefs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpRingBuffer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpFileSystem_Win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpMemoryBuffer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpPLGlueDisplayDriver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpFileStream_Win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpSystemServices_Win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpFiberStarter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpFiber_Win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpFiber.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="IGpAudioDriver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpAudioDriverFactory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpPLGlueAudioDriver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpPLGlueAudioChannel.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="IGpAudioChannel.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpMutex_Win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpThreadEvent_Win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\IGpAudioChannelCallbacks.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpFontHandlerFactory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpFontHandler_FreeType2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpVOSEventQueue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\IGpDisplayDriverSurface.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpComPtr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\IGpColorCursor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\GpColorCursor_Win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\EGpStandardCursor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpInputDriverFactory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\EGpInputDriverType.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\GpInputDriverProperties.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\GpDisplayDriverTickStatus.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\GpFileCreationDisposition.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\GpApplicationName.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Aerofoil.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="ConvertedResources\Large128.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="ConvertedResources\Small128.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>

BIN
Aerofoil/Aerofoil.rc Normal file

Binary file not shown.

233
Aerofoil/Aerofoil.vcxproj Normal file
View File

@@ -0,0 +1,233 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}</ProjectGuid>
<RootNamespace>Aerofoil</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\Common.props" />
<Import Project="..\GpCommon.props" />
<Import Project="..\GpMainApp.props" />
<Import Project="..\FreeTypePublic.props" />
<Import Project="..\FreeTypeImport.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\Common.props" />
<Import Project="..\GpCommon.props" />
<Import Project="..\GpMainApp.props" />
<Import Project="..\FreeTypePublic.props" />
<Import Project="..\FreeTypeImport.props" />
<Import Project="..\Release.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\Common.props" />
<Import Project="..\GpCommon.props" />
<Import Project="..\GpMainApp.props" />
<Import Project="..\FreeTypePublic.props" />
<Import Project="..\FreeTypeImport.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\Common.props" />
<Import Project="..\GpCommon.props" />
<Import Project="..\GpMainApp.props" />
<Import Project="..\FreeTypePublic.props" />
<Import Project="..\FreeTypeImport.props" />
<Import Project="..\Release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="GpAppEnvironment.cpp" />
<ClCompile Include="GpAudioDriverFactory.cpp" />
<ClCompile Include="GpColorCursor_Win32.cpp" />
<ClCompile Include="GpDisplayDriverFactory.cpp" />
<ClCompile Include="GpFiber_Win32.cpp" />
<ClCompile Include="GpFileStream_Win32.cpp" />
<ClCompile Include="GpFileSystem_Win32.cpp" />
<ClCompile Include="GpFontHandlerFactory.cpp" />
<ClCompile Include="GpFontHandler_FreeType2.cpp" />
<ClCompile Include="GpGlobalConfig.cpp" />
<ClCompile Include="GpInputDriverFactory.cpp" />
<ClCompile Include="GpMain.cpp" />
<ClCompile Include="GpMain_Win32.cpp" />
<ClCompile Include="GpMemoryBuffer.cpp" />
<ClCompile Include="GpMutex_Win32.cpp" />
<ClCompile Include="GpSystemServices_Win32.cpp" />
<ClCompile Include="GpFiberStarter_Win32.cpp" />
<ClCompile Include="GpThreadEvent_Win32.cpp" />
<ClCompile Include="GpVOSEventQueue.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\GpCommon\EGpInputDriverType.h" />
<ClInclude Include="..\GpCommon\EGpStandardCursor.h" />
<ClInclude Include="..\GpCommon\GpApplicationName.h" />
<ClInclude Include="..\GpCommon\GpDisplayDriverTickStatus.h" />
<ClInclude Include="..\GpCommon\GpFileCreationDisposition.h" />
<ClInclude Include="..\GpCommon\GpInputDriverProperties.h" />
<ClInclude Include="..\GpCommon\IGpCursor.h" />
<ClInclude Include="..\GpCommon\IGpAudioChannelCallbacks.h" />
<ClInclude Include="..\GpCommon\GpColorCursor_Win32.h" />
<ClInclude Include="..\GpCommon\IGpDisplayDriverSurface.h" />
<ClInclude Include="GpAppEnvironment.h" />
<ClInclude Include="GpAudioDriverFactory.h" />
<ClInclude Include="GpComPtr.h" />
<ClInclude Include="GpCoreDefs.h" />
<ClInclude Include="GpDisplayDriverFactory.h" />
<ClInclude Include="GpFiber.h" />
<ClInclude Include="GpFiber_Win32.h" />
<ClInclude Include="GpFileStream_Win32.h" />
<ClInclude Include="GpFileSystem_Win32.h" />
<ClInclude Include="GpFontHandler_FreeType2.h" />
<ClInclude Include="GpFontHandlerFactory.h" />
<ClInclude Include="GpGlobalConfig.h" />
<ClInclude Include="GpInputDriverFactory.h" />
<ClInclude Include="GpMain.h" />
<ClInclude Include="GpMemoryBuffer.h" />
<ClInclude Include="GpMutex_Win32.h" />
<ClInclude Include="GpRingBuffer.h" />
<ClInclude Include="GpSystemServices_Win32.h" />
<ClInclude Include="GpFiberStarter.h" />
<ClInclude Include="GpThreadEvent_Win32.h" />
<ClInclude Include="GpVOSEventQueue.h" />
<ClInclude Include="GpWindows.h" />
<ClInclude Include="IGpAudioChannel.h" />
<ClInclude Include="IGpAudioDriver.h" />
<ClInclude Include="IGpDisplayDriver.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FreeType\FreeType.vcxproj">
<Project>{487216d8-16ba-4b4c-b5bf-43feedfee03a}</Project>
</ProjectReference>
<ProjectReference Include="..\GpApp\GpApp.vcxproj">
<Project>{6233c3f2-5781-488e-b190-4fa8836f5a77}</Project>
</ProjectReference>
<ProjectReference Include="..\GpAudioDriver_XAudio2\GpAudioDriver_XAudio2.vcxproj">
<Project>{e3bdc783-8646-433e-adf0-8b6390d36669}</Project>
</ProjectReference>
<ProjectReference Include="..\GpDisplayDriver_D3D11\GpDisplayDriver_D3D11.vcxproj">
<Project>{ffc961ac-55b4-4a38-a83e-06ae98f59acc}</Project>
</ProjectReference>
<ProjectReference Include="..\GpInputDriver_XInput\GpInputDriver_XInput.vcxproj">
<Project>{17b96f07-ef92-47cd-95a5-8e6ee38ab564}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Aerofoil.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="ConvertedResources\Large128.ico" />
<Image Include="ConvertedResources\Small128.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

View File

@@ -0,0 +1,185 @@
#include "GpAppEnvironment.h"
#include "GpFiberStarter.h"
#include "GpAppInterface.h"
#include "GpDisplayDriverTickStatus.h"
#include "GpFontHandlerFactory.h"
#include "HostSuspendCallArgument.h"
#include "IGpDisplayDriver.h"
#include "IGpFiber.h"
#include "IGpInputDriver.h"
#include <assert.h>
GpAppEnvironment::GpAppEnvironment()
: m_applicationState(ApplicationState_NotStarted)
, m_displayDriver(nullptr)
, m_audioDriver(nullptr)
, m_inputDrivers(nullptr)
, m_numInputDrivers(0)
, m_fontHandler(nullptr)
, m_vosEventQueue(nullptr)
, m_applicationFiber(nullptr)
, m_vosFiber(nullptr)
, m_suspendCallID(PortabilityLayer::HostSuspendCallID_Unknown)
, m_suspendArgs(nullptr)
, m_suspendReturnValue(nullptr)
{
}
GpAppEnvironment::~GpAppEnvironment()
{
assert(m_applicationFiber == nullptr);
}
void GpAppEnvironment::Init()
{
}
GpDisplayDriverTickStatus_t GpAppEnvironment::Tick(IGpFiber *vosFiber)
{
GpAppInterface_Get()->PL_IncrementTickCounter(1);
m_vosFiber = vosFiber;
if (m_applicationState == ApplicationState_WaitingForEvents)
m_applicationState = ApplicationState_Running;
for (;;)
{
switch (m_applicationState)
{
case ApplicationState_NotStarted:
InitializeApplicationState();
m_applicationFiber = GpFiberStarter::StartFiber(GpAppEnvironment::StaticAppThreadFunc, this, vosFiber);
m_applicationState = ApplicationState_Running;
break;
case ApplicationState_WaitingForEvents:
return GpDisplayDriverTickStatuses::kOK;
case ApplicationState_Running:
SynchronizeState();
m_applicationFiber->YieldTo();
break;
case ApplicationState_SystemCall:
{
PortabilityLayer::HostSuspendCallID callID = m_suspendCallID;
const PortabilityLayer::HostSuspendCallArgument *args = m_suspendArgs;
PortabilityLayer::HostSuspendCallArgument *returnValue = m_suspendReturnValue;
DispatchSystemCall(callID, args, returnValue);
assert(m_applicationState != ApplicationState_SystemCall);
}
break;
case ApplicationState_TimedSuspend:
if (m_delaySuspendTicks == 0)
m_applicationState = ApplicationState_Running;
else
{
m_delaySuspendTicks--;
return GpDisplayDriverTickStatuses::kOK;
}
break;
case ApplicationState_Terminated:
m_applicationFiber->Destroy();
m_applicationFiber = nullptr;
return GpDisplayDriverTickStatuses::kApplicationTerminated;
default:
assert(false);
break;
};
}
}
void GpAppEnvironment::Render()
{
GpAppInterface_Get()->PL_Render(m_displayDriver);
}
bool GpAppEnvironment::AdjustRequestedResolution(uint32_t &physicalWidth, uint32_t &physicalHeight, uint32_t &virtualWidth, uint32_t &virtualheight, float &pixelScaleX, float &pixelScaleY)
{
return GpAppInterface_Get()->PL_AdjustRequestedResolution(physicalWidth, physicalHeight, virtualWidth, virtualheight, pixelScaleX, pixelScaleY);
}
void GpAppEnvironment::SetDisplayDriver(IGpDisplayDriver *displayDriver)
{
m_displayDriver = displayDriver;
}
void GpAppEnvironment::SetAudioDriver(IGpAudioDriver *audioDriver)
{
m_audioDriver = audioDriver;
}
void GpAppEnvironment::SetInputDrivers(IGpInputDriver *const* inputDrivers, size_t numDrivers)
{
m_inputDrivers = inputDrivers;
m_numInputDrivers = numDrivers;
}
void GpAppEnvironment::SetFontHandler(PortabilityLayer::HostFontHandler *fontHandler)
{
m_fontHandler = fontHandler;
}
void GpAppEnvironment::SetVOSEventQueue(GpVOSEventQueue *eventQueue)
{
m_vosEventQueue = eventQueue;
}
void GpAppEnvironment::StaticAppThreadFunc(void *context)
{
static_cast<GpAppEnvironment*>(context)->AppThreadFunc();
}
void GpAppEnvironment::AppThreadFunc()
{
GpAppInterface_Get()->ApplicationMain();
m_applicationState = ApplicationState_Terminated;
m_vosFiber->YieldTo();
}
void GpAppEnvironment::InitializeApplicationState()
{
GpAppInterface_Get()->PL_HostDisplayDriver_SetInstance(m_displayDriver);
GpAppInterface_Get()->PL_HostAudioDriver_SetInstance(m_audioDriver);
GpAppInterface_Get()->PL_InstallHostSuspendHook(GpAppEnvironment::StaticSuspendHookFunc, this);
GpAppInterface_Get()->PL_HostFontHandler_SetInstance(m_fontHandler);
GpAppInterface_Get()->PL_HostVOSEventQueue_SetInstance(m_vosEventQueue);
}
void GpAppEnvironment::SynchronizeState()
{
const size_t numInputDrivers = m_numInputDrivers;
for (size_t i = 0; i < numInputDrivers; i++)
m_inputDrivers[i]->ProcessInput();
}
void GpAppEnvironment::StaticSuspendHookFunc(void *context, PortabilityLayer::HostSuspendCallID callID, const PortabilityLayer::HostSuspendCallArgument *args, PortabilityLayer::HostSuspendCallArgument *returnValue)
{
GpAppEnvironment *appEnv = static_cast<GpAppEnvironment*>(context);
appEnv->m_suspendCallID = callID;
appEnv->m_suspendArgs = args;
appEnv->m_suspendReturnValue = returnValue;
appEnv->m_applicationState = ApplicationState_SystemCall;
appEnv->m_vosFiber->YieldTo();
}
void GpAppEnvironment::DispatchSystemCall(PortabilityLayer::HostSuspendCallID callID, const PortabilityLayer::HostSuspendCallArgument *args, PortabilityLayer::HostSuspendCallArgument *returnValue)
{
switch (callID)
{
case PortabilityLayer::HostSuspendCallID_Delay:
m_applicationState = ApplicationState_TimedSuspend;
m_delaySuspendTicks = args[0].m_uint;
break;
case PortabilityLayer::HostSuspendCallID_CallOnVOSThread:
args[0].m_functionPtr(static_cast<const PortabilityLayer::HostSuspendCallArgument*>(args[1].m_constPointer), static_cast<PortabilityLayer::HostSuspendCallArgument*>(args[2].m_pointer));
m_applicationState = ApplicationState_Running;
break;
default:
assert(false);
}
}

View File

@@ -0,0 +1,73 @@
#pragma once
#include "GpDisplayDriverTickStatus.h"
#include "GpVOSEventQueue.h"
#include "HostSuspendCallID.h"
#include <stdint.h>
namespace PortabilityLayer
{
union HostSuspendCallArgument;
class HostFontHandler;
class HostVOSEventQueue;
}
struct IGpDisplayDriver;
struct IGpAudioDriver;
struct IGpInputDriver;
struct IGpFiber;
class GpAppEnvironment
{
public:
GpAppEnvironment();
~GpAppEnvironment();
void Init();
GpDisplayDriverTickStatus_t Tick(IGpFiber *vosFiber);
void Render();
bool AdjustRequestedResolution(uint32_t &physicalWidth, uint32_t &physicalHeight, uint32_t &virtualWidth, uint32_t &virtualheight, float &pixelScaleX, float &pixelScaleY);
void SetDisplayDriver(IGpDisplayDriver *displayDriver);
void SetAudioDriver(IGpAudioDriver *audioDriver);
void SetInputDrivers(IGpInputDriver *const* inputDrivers, size_t numDrivers);
void SetFontHandler(PortabilityLayer::HostFontHandler *fontHandler);
void SetVOSEventQueue(GpVOSEventQueue *eventQueue);
private:
enum ApplicationState
{
ApplicationState_NotStarted,
ApplicationState_WaitingForEvents,
ApplicationState_Running,
ApplicationState_Terminated,
ApplicationState_SystemCall,
ApplicationState_TimedSuspend,
};
static void StaticAppThreadFunc(void *context);
void AppThreadFunc();
void InitializeApplicationState();
void SynchronizeState();
static void StaticSuspendHookFunc(void *context, PortabilityLayer::HostSuspendCallID callID, const PortabilityLayer::HostSuspendCallArgument *args, PortabilityLayer::HostSuspendCallArgument *returnValue);
void DispatchSystemCall(PortabilityLayer::HostSuspendCallID callID, const PortabilityLayer::HostSuspendCallArgument *args, PortabilityLayer::HostSuspendCallArgument *returnValue);
ApplicationState m_applicationState;
IGpDisplayDriver *m_displayDriver;
IGpAudioDriver *m_audioDriver;
IGpInputDriver *const* m_inputDrivers;
PortabilityLayer::HostFontHandler *m_fontHandler;
GpVOSEventQueue *m_vosEventQueue;
IGpFiber *m_applicationFiber;
IGpFiber *m_vosFiber;
uint32_t m_delaySuspendTicks;
size_t m_numInputDrivers;
PortabilityLayer::HostSuspendCallID m_suspendCallID;
const PortabilityLayer::HostSuspendCallArgument *m_suspendArgs;
PortabilityLayer::HostSuspendCallArgument *m_suspendReturnValue;
};

View File

@@ -0,0 +1,23 @@
#include "GpAudioDriverFactory.h"
#include "GpAudioDriverProperties.h"
#include <assert.h>
IGpAudioDriver *GpAudioDriverFactory::CreateAudioDriver(const GpAudioDriverProperties &properties)
{
assert(properties.m_type < EGpAudioDriverType_Count);
if (ms_registry[properties.m_type])
return ms_registry[properties.m_type](properties);
else
return nullptr;
}
void GpAudioDriverFactory::RegisterAudioDriverFactory(EGpAudioDriverType type, FactoryFunc_t func)
{
assert(type < EGpAudioDriverType_Count);
ms_registry[type] = func;
}
GpAudioDriverFactory::FactoryFunc_t GpAudioDriverFactory::ms_registry[EGpAudioDriverType_Count];

View File

@@ -0,0 +1,18 @@
#pragma once
#include "EGpAudioDriverType.h"
struct IGpAudioDriver;
struct GpAudioDriverProperties;
class GpAudioDriverFactory
{
public:
typedef IGpAudioDriver *(*FactoryFunc_t)(const GpAudioDriverProperties &properties);
static IGpAudioDriver *CreateAudioDriver(const GpAudioDriverProperties &properties);
static void RegisterAudioDriverFactory(EGpAudioDriverType type, FactoryFunc_t func);
private:
static FactoryFunc_t ms_registry[EGpAudioDriverType_Count];
};

View File

@@ -0,0 +1,58 @@
#include "GpCursor_Win32.h"
#include <stdlib.h>
#include <new>
void GpCursor_Win32::Destroy()
{
this->DecRef();
}
IGpCursor_Win32 *GpCursor_Win32::Load(const wchar_t *path)
{
HANDLE imageH = LoadImageW(nullptr, path, IMAGE_CURSOR, 0, 0, LR_LOADFROMFILE);
if (imageH == nullptr)
return nullptr;
HCURSOR cursor = reinterpret_cast<HCURSOR>(imageH);
void *storage = malloc(sizeof(GpCursor_Win32));
if (!storage)
{
DestroyCursor(cursor);
return nullptr;
}
return new (storage) GpCursor_Win32(reinterpret_cast<HCURSOR>(cursor));
}
GpCursor_Win32::GpCursor_Win32(HCURSOR cursor)
: m_cursor(cursor)
, m_refCount(1)
{
}
GpCursor_Win32::~GpCursor_Win32()
{
DestroyCursor(m_cursor);
}
const HCURSOR &GpCursor_Win32::GetHCursor() const
{
return m_cursor;
}
void GpCursor_Win32::IncRef()
{
m_refCount++;
}
void GpCursor_Win32::DecRef()
{
m_refCount--;
if (m_refCount == 0)
{
this->~GpCursor_Win32();
free(this);
}
}

View File

@@ -0,0 +1,33 @@
#pragma once
#include "IGpColorCursor.h"
#include "GpWindows.h"
struct IGpColorCursor_Win32 : public IGpColorCursor
{
virtual const HCURSOR &GetHCursor() const = 0;
virtual void IncRef() = 0;
virtual void DecRef() = 0;
};
class GpColorCursor_Win32 final : public IGpColorCursor_Win32
{
public:
void Destroy() override;
const HCURSOR &GetHCursor() const override;
void IncRef() override;
void DecRef() override;
static IGpColorCursor_Win32 *Load(const wchar_t *path);
private:
GpColorCursor_Win32(HCURSOR cursor);
~GpColorCursor_Win32();
HCURSOR m_cursor;
int m_refCount;
};

View File

@@ -0,0 +1,23 @@
#include "GpDisplayDriverFactory.h"
#include "GpDisplayDriverProperties.h"
#include <assert.h>
IGpDisplayDriver *GpDisplayDriverFactory::CreateDisplayDriver(const GpDisplayDriverProperties &properties)
{
assert(properties.m_type < EGpDisplayDriverType_Count);
if (ms_registry[properties.m_type])
return ms_registry[properties.m_type](properties);
else
return nullptr;
}
void GpDisplayDriverFactory::RegisterDisplayDriverFactory(EGpDisplayDriverType type, FactoryFunc_t func)
{
assert(type < EGpDisplayDriverType_Count);
ms_registry[type] = func;
}
GpDisplayDriverFactory::FactoryFunc_t GpDisplayDriverFactory::ms_registry[EGpDisplayDriverType_Count];

View File

@@ -0,0 +1,18 @@
#pragma once
#include "EGpDisplayDriverType.h"
struct IGpDisplayDriver;
struct GpDisplayDriverProperties;
class GpDisplayDriverFactory
{
public:
typedef IGpDisplayDriver *(*FactoryFunc_t)(const GpDisplayDriverProperties &properties);
static IGpDisplayDriver *CreateDisplayDriver(const GpDisplayDriverProperties &properties);
static void RegisterDisplayDriverFactory(EGpDisplayDriverType type, FactoryFunc_t func);
private:
static FactoryFunc_t ms_registry[EGpDisplayDriverType_Count];
};

11
Aerofoil/GpFiberStarter.h Normal file
View File

@@ -0,0 +1,11 @@
#pragma once
struct IGpFiber;
class GpFiberStarter
{
public:
typedef void(*ThreadFunc_t)(void *context);
static IGpFiber *StartFiber(ThreadFunc_t threadFunc, void *context, IGpFiber *creatingFiber);
};

View File

@@ -0,0 +1,56 @@
#include "GpFiberStarter.h"
#include "GpFiber_Win32.h"
#include "GpWindows.h"
#include <assert.h>
namespace GpFiberStarter_Win32
{
struct FiberStartState
{
GpFiberStarter::ThreadFunc_t m_threadFunc;
IGpFiber *m_creatingFiber;
void *m_context;
};
static VOID WINAPI FiberStartRoutine(LPVOID lpThreadParameter)
{
const FiberStartState *tss = static_cast<const FiberStartState*>(lpThreadParameter);
GpFiberStarter::ThreadFunc_t threadFunc = tss->m_threadFunc;
IGpFiber *creatingFiber = tss->m_creatingFiber;
void *context = tss->m_context;
creatingFiber->YieldTo();
threadFunc(context);
assert(!"Fiber function exited");
}
}
IGpFiber *GpFiberStarter::StartFiber(ThreadFunc_t threadFunc, void *context, IGpFiber *creatingFiber)
{
ULONG_PTR lowLimit;
ULONG_PTR highLimit;
#if 0
GetCurrentThreadStackLimits(&lowLimit, &highLimit);
ULONG_PTR stackSize = highLimit - lowLimit;
#else
ULONG_PTR stackSize = 1024 * 1024;
#endif
GpFiberStarter_Win32::FiberStartState startState;
startState.m_context = context;
startState.m_creatingFiber = creatingFiber;
startState.m_threadFunc = threadFunc;
void *fiber = CreateFiber(static_cast<SIZE_T>(stackSize), GpFiberStarter_Win32::FiberStartRoutine, &startState);
if (!fiber)
return nullptr;
SwitchToFiber(fiber);
return GpFiber_Win32::Create(fiber);
}

View File

@@ -0,0 +1,32 @@
#include "GpFiber_Win32.h"
#include <new>
GpFiber_Win32::GpFiber_Win32(LPVOID fiber)
: m_fiber(fiber)
{
}
void GpFiber_Win32::YieldTo()
{
SwitchToFiber(m_fiber);
}
void GpFiber_Win32::Destroy()
{
this->~GpFiber_Win32();
free(this);
}
GpFiber_Win32::~GpFiber_Win32()
{
DeleteFiber(m_fiber);
}
IGpFiber *GpFiber_Win32::Create(LPVOID fiber)
{
void *storage = malloc(sizeof(GpFiber_Win32));
if (!storage)
return nullptr;
return new (storage) GpFiber_Win32(fiber);
}

18
Aerofoil/GpFiber_Win32.h Normal file
View File

@@ -0,0 +1,18 @@
#pragma once
#include "GpWindows.h"
#include "IGpFiber.h"
class GpFiber_Win32 final : public IGpFiber
{
public:
void YieldTo() override;
void Destroy() override;
static IGpFiber *Create(LPVOID fiber);
private:
explicit GpFiber_Win32(LPVOID fiber);
~GpFiber_Win32();
LPVOID m_fiber;
};

View File

@@ -0,0 +1,144 @@
#include "GpFileStream_Win32.h"
GpFileStream_Win32::GpFileStream_Win32(HANDLE handle, bool readable, bool writeable, bool seekable)
: m_handle(handle)
, m_readable(readable)
, m_writeable(writeable)
, m_seekable(seekable)
{
}
size_t GpFileStream_Win32::Read(void *bytesOut, size_t size)
{
if (!m_readable)
return 0;
size_t totalRead = 0;
while (size)
{
const DWORD chunkSizeToRead = (size > MAXDWORD) ? MAXDWORD : size;
DWORD numRead = 0;
BOOL readSucceeded = ReadFile(m_handle, bytesOut, chunkSizeToRead, &numRead, nullptr);
if (!readSucceeded)
return totalRead;
totalRead += static_cast<size_t>(numRead);
size -= static_cast<size_t>(numRead);
bytesOut = static_cast<void*>(static_cast<uint8_t*>(bytesOut) + numRead);
if (numRead != chunkSizeToRead)
return totalRead;
}
return totalRead;
}
size_t GpFileStream_Win32::Write(const void *bytes, size_t size)
{
if (!m_writeable)
return 0;
size_t totalWritten = 0;
while (size)
{
const DWORD chunkSizeToWrite = (size > MAXDWORD) ? MAXDWORD : size;
DWORD numWritten = 0;
BOOL writeSucceeded = WriteFile(m_handle, bytes, chunkSizeToWrite, &numWritten, nullptr);
if (!writeSucceeded)
{
DWORD lastError = GetLastError();
return totalWritten;
}
totalWritten += static_cast<size_t>(numWritten);
size -= static_cast<size_t>(numWritten);
bytes = static_cast<const void*>(static_cast<const uint8_t*>(bytes) + numWritten);
if (numWritten != chunkSizeToWrite)
return totalWritten;
}
return totalWritten;
}
bool GpFileStream_Win32::IsSeekable() const
{
return m_seekable;
}
bool GpFileStream_Win32::IsReadOnly() const
{
return !m_writeable;
}
bool GpFileStream_Win32::IsWriteOnly() const
{
return !m_readable;
}
bool GpFileStream_Win32::SeekStart(PortabilityLayer::UFilePos_t loc)
{
LARGE_INTEGER li;
li.QuadPart = static_cast<LONGLONG>(loc);
return SetFilePointerEx(m_handle, li, nullptr, FILE_BEGIN) != 0;
}
bool GpFileStream_Win32::SeekCurrent(PortabilityLayer::FilePos_t loc)
{
LARGE_INTEGER li;
li.QuadPart = static_cast<LONGLONG>(loc);
return SetFilePointerEx(m_handle, li, nullptr, FILE_CURRENT) != 0;
}
bool GpFileStream_Win32::SeekEnd(PortabilityLayer::UFilePos_t loc)
{
LARGE_INTEGER li;
li.QuadPart = -static_cast<LONGLONG>(loc);
return SetFilePointerEx(m_handle, li, nullptr, FILE_END) != 0;
}
bool GpFileStream_Win32::Truncate(PortabilityLayer::UFilePos_t loc)
{
if (!m_writeable)
return false;
PortabilityLayer::UFilePos_t oldPos = Tell();
if (!SeekStart(loc))
return false;
if (!SetEndOfFile(m_handle))
return false;
if (!SeekStart(oldPos))
return false;
return true;
}
PortabilityLayer::UFilePos_t GpFileStream_Win32::Size() const
{
LARGE_INTEGER fsize;
if (!GetFileSizeEx(m_handle, &fsize))
return 0;
return static_cast<PortabilityLayer::UFilePos_t>(fsize.QuadPart);
}
PortabilityLayer::UFilePos_t GpFileStream_Win32::Tell() const
{
LARGE_INTEGER zero;
zero.QuadPart = 0;
LARGE_INTEGER fpos;
if (!SetFilePointerEx(m_handle, zero, &fpos, FILE_CURRENT))
return 0;
return static_cast<PortabilityLayer::UFilePos_t>(fpos.QuadPart);
}
void GpFileStream_Win32::Close()
{
CloseHandle(m_handle);
}

View File

@@ -0,0 +1,30 @@
#pragma once
#include "GpCoreDefs.h"
#include "GpWindows.h"
#include "IOStream.h"
class GpFileStream_Win32 final : public PortabilityLayer::IOStream
{
public:
explicit GpFileStream_Win32(HANDLE handle, bool readable, bool writeable, bool seekable);
size_t Read(void *bytesOut, size_t size) override;
size_t Write(const void *bytes, size_t size) override;
bool IsSeekable() const override;
bool IsReadOnly() const override;
bool IsWriteOnly() const override;
bool SeekStart(PortabilityLayer::UFilePos_t loc) override;
bool SeekCurrent(PortabilityLayer::FilePos_t loc) override;
bool SeekEnd(PortabilityLayer::UFilePos_t loc) override;
bool Truncate(PortabilityLayer::UFilePos_t loc) override;
PortabilityLayer::UFilePos_t Size() const override;
PortabilityLayer::UFilePos_t Tell() const override;
void Close() override;
private:
HANDLE m_handle;
bool m_readable;
bool m_writeable;
bool m_seekable;
};

View File

@@ -0,0 +1,545 @@
#include "GpFileSystem_Win32.h"
#include "GpApplicationName.h"
#include "GpFileStream_Win32.h"
#include "GpWindows.h"
#include "GpMemoryBuffer.h"
#include "HostDirectoryCursor.h"
#include <string>
#include <Shlwapi.h>
#include <ShlObj.h>
#include <commdlg.h>
#include <assert.h>
extern GpWindowsGlobals g_gpWindowsGlobals;
class GpDirectoryCursor_Win32 final : public PortabilityLayer::HostDirectoryCursor
{
public:
static GpDirectoryCursor_Win32 *Create(const HANDLE &handle, const WIN32_FIND_DATAW &findData);
bool GetNext(const char *&outFileName) override;
void Destroy() override;
private:
GpDirectoryCursor_Win32(const HANDLE &handle, const WIN32_FIND_DATAW &findData);
~GpDirectoryCursor_Win32();
HANDLE m_handle;
WIN32_FIND_DATAW m_findData;
char m_chars[MAX_PATH + 1];
bool m_haveNext;
};
GpDirectoryCursor_Win32 *GpDirectoryCursor_Win32::Create(const HANDLE &handle, const WIN32_FIND_DATAW &findData)
{
void *storage = malloc(sizeof(GpDirectoryCursor_Win32));
if (!storage)
return nullptr;
return new (storage) GpDirectoryCursor_Win32(handle, findData);
}
bool GpDirectoryCursor_Win32::GetNext(const char *&outFileName)
{
while (m_haveNext)
{
bool haveResult = false;
bool hasInvalidChars = false;
for (const wchar_t *fnameScan = m_findData.cFileName; *fnameScan; fnameScan++)
{
const int32_t asInt = static_cast<int32_t>(*fnameScan);
if (asInt < 1 || asInt >= 128)
{
hasInvalidChars = true;
break;
}
}
if (!hasInvalidChars && wcscmp(m_findData.cFileName, L".") && wcscmp(m_findData.cFileName, L".."))
{
const size_t len = wcslen(m_findData.cFileName);
haveResult = true;
for (size_t i = 0; i <= len; i++)
m_chars[i] = static_cast<char>(m_findData.cFileName[i]);
}
m_haveNext = (FindNextFileW(m_handle, &m_findData) != FALSE);
if (haveResult)
{
outFileName = m_chars;
return true;
}
}
return false;
}
void GpDirectoryCursor_Win32::Destroy()
{
this->~GpDirectoryCursor_Win32();
free(this);
}
GpDirectoryCursor_Win32::GpDirectoryCursor_Win32(const HANDLE &handle, const WIN32_FIND_DATAW &findData)
: m_handle(handle)
, m_findData(findData)
, m_haveNext(true)
{
}
GpDirectoryCursor_Win32::~GpDirectoryCursor_Win32()
{
FindClose(m_handle);
}
GpFileSystem_Win32::GpFileSystem_Win32()
{
// GP TODO: This shouldn't be static init since it allocates memory
m_executablePath[0] = 0;
PWSTR docsPath;
if (!FAILED(SHGetKnownFolderPath(FOLDERID_Documents, KF_FLAG_DEFAULT, nullptr, &docsPath)))
{
try
{
m_prefsDir = docsPath;
}
catch(...)
{
CoTaskMemFree(docsPath);
throw;
}
m_prefsDir.append(L"\\" GP_APPLICATION_NAME_W);
m_userHousesDir = m_prefsDir + L"\\Houses";
m_userSavesDir = m_prefsDir + L"\\SavedGames";
m_scoresDir = m_prefsDir + L"\\Scores";
CreateDirectoryW(m_prefsDir.c_str(), nullptr);
CreateDirectoryW(m_scoresDir.c_str(), nullptr);
CreateDirectoryW(m_userHousesDir.c_str(), nullptr);
CreateDirectoryW(m_userSavesDir.c_str(), nullptr);
m_prefsDir.append(L"\\");
m_scoresDir.append(L"\\");
m_userHousesDir.append(L"\\");
m_userSavesDir.append(L"\\");
}
DWORD modulePathSize = GetModuleFileNameW(nullptr, m_executablePath, MAX_PATH);
if (modulePathSize == MAX_PATH || modulePathSize == 0)
m_executablePath[0] = 0;
size_t currentPathLength = wcslen(m_executablePath);
for (;;)
{
while (currentPathLength > 0 && m_executablePath[currentPathLength - 1] != '\\')
currentPathLength--;
m_executablePath[currentPathLength] = 0;
if (currentPathLength + 11 > MAX_PATH)
{
// "Resources" append is a longer path than the executable
continue;
}
if (wcscat_s(m_executablePath, L"Resources"))
{
currentPathLength = 0;
break;
}
if (PathFileExistsW(m_executablePath) && PathIsDirectoryW(m_executablePath))
{
m_executablePath[currentPathLength] = 0;
break;
}
else
currentPathLength--;
}
if (currentPathLength > 0)
{
m_packagedDir = std::wstring(m_executablePath) + L"Packaged\\";
m_housesDir = std::wstring(m_executablePath) + L"Packaged\\Houses\\";
m_resourcesDir = std::wstring(m_executablePath) + L"Resources\\";
}
}
bool GpFileSystem_Win32::FileExists(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path)
{
wchar_t winPath[MAX_PATH + 1];
if (!ResolvePath(virtualDirectory, path, winPath))
return false;
return PathFileExistsW(winPath) != 0;
}
bool GpFileSystem_Win32::FileLocked(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool *exists)
{
wchar_t winPath[MAX_PATH + 1];
if (!ResolvePath(virtualDirectory, path, winPath))
{
*exists = false;
return false;
}
DWORD attribs = GetFileAttributesW(winPath);
if (attribs == INVALID_FILE_ATTRIBUTES)
{
*exists = false;
return false;
}
*exists = true;
return (attribs & FILE_ATTRIBUTE_READONLY) != 0;
}
PortabilityLayer::IOStream *GpFileSystem_Win32::OpenFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool writeAccess, GpFileCreationDisposition_t createDisposition)
{
wchar_t winPath[MAX_PATH + 1];
if (!ResolvePath(virtualDirectory, path, winPath))
return false;
const DWORD desiredAccess = writeAccess ? (GENERIC_WRITE | GENERIC_READ) : GENERIC_READ;
DWORD winCreationDisposition = 0;
switch (createDisposition)
{
case GpFileCreationDispositions::kCreateOrOverwrite:
winCreationDisposition = CREATE_ALWAYS;
break;
case GpFileCreationDispositions::kCreateNew:
winCreationDisposition = CREATE_NEW;
break;
case GpFileCreationDispositions::kCreateOrOpen:
winCreationDisposition = OPEN_ALWAYS;
break;
case GpFileCreationDispositions::kOpenExisting:
winCreationDisposition = OPEN_EXISTING;
break;
case GpFileCreationDispositions::kOverwriteExisting:
winCreationDisposition = TRUNCATE_EXISTING;
break;
default:
return false;
}
HANDLE h = CreateFileW(winPath, desiredAccess, FILE_SHARE_READ, nullptr, winCreationDisposition, FILE_ATTRIBUTE_NORMAL, nullptr);
if (h == INVALID_HANDLE_VALUE)
return false;
return new GpFileStream_Win32(h, true, writeAccess, true);
}
bool GpFileSystem_Win32::DeleteFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool &existed)
{
wchar_t winPath[MAX_PATH + 1];
if (!ResolvePath(virtualDirectory, path, winPath))
return false;
if (DeleteFileW(winPath))
{
existed = true;
return true;
}
DWORD err = GetLastError();
if (err == ERROR_FILE_NOT_FOUND)
existed = false;
else
existed = true;
return false;
}
PortabilityLayer::HostDirectoryCursor *GpFileSystem_Win32::ScanDirectory(PortabilityLayer::VirtualDirectory_t virtualDirectory)
{
wchar_t winPath[MAX_PATH + 2];
if (!ResolvePath(virtualDirectory, "*", winPath))
return nullptr;
WIN32_FIND_DATAW findData;
HANDLE ff = FindFirstFileW(winPath, &findData);
if (ff == INVALID_HANDLE_VALUE)
return nullptr;
return GpDirectoryCursor_Win32::Create(ff, findData);
}
bool GpFileSystem_Win32::PromptSaveFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, char *path, size_t &outPathLength, size_t pathCapacity, const char *initialFileName)
{
wchar_t baseFN[MAX_PATH + 5];
wchar_t baseDir[MAX_PATH + 5];
const size_t existingPathLen = strlen(initialFileName);
if (existingPathLen >= MAX_PATH)
return false;
for (size_t i = 0; i < existingPathLen; i++)
baseFN[i] = static_cast<wchar_t>(initialFileName[i]);
baseFN[existingPathLen] = 0;
if (!ResolvePath(virtualDirectory, "", baseDir))
return false;
OPENFILENAMEW ofn;
memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFilter = GP_APPLICATION_NAME_W L" File (*.gpf)\0*.gpf\0";
ofn.lpstrFile = baseFN;
ofn.lpstrDefExt = L"gpf";
ofn.nMaxFile = MAX_PATH;
ofn.lpstrInitialDir = baseDir;
ofn.Flags = OFN_EXPLORER | OFN_NOCHANGEDIR | OFN_OVERWRITEPROMPT;
ofn.hwndOwner = g_gpWindowsGlobals.m_hwnd;
if (!GetSaveFileNameW(&ofn))
return false;
if (ofn.Flags & OFN_EXTENSIONDIFFERENT)
{
MessageBeep(MB_ICONERROR);
MessageBoxW(nullptr, L"Save file failed: Saved files must have the '.gpf' extension", L"Invalid file path", MB_OK);
return false;
}
const wchar_t *fn = ofn.lpstrFile + ofn.nFileOffset;
size_t fnLengthWithoutExt = wcslen(fn);
if (ofn.nFileExtension - 1 > ofn.nFileOffset) // Off by 1 because extension doesn't include .
fnLengthWithoutExt = ofn.nFileExtension - ofn.nFileOffset - 1;
if (fnLengthWithoutExt >= pathCapacity)
{
wchar_t msg[256];
wsprintfW(msg, L"Save file failed: File name is too long. Limit is %i characters.", static_cast<int>(pathCapacity));
MessageBeep(MB_ICONERROR);
MessageBoxW(nullptr, msg, L"Invalid file path", MB_OK);
return false;
}
if (ofn.nFileOffset != wcslen(baseDir) || memcmp(ofn.lpstrFile, baseDir, ofn.nFileOffset * sizeof(wchar_t)))
{
wchar_t msg[256 + MAX_PATH];
wsprintfW(msg, L"Save file failed: File can't be saved here, it must be saved in %s", baseDir);
MessageBeep(MB_ICONERROR);
MessageBoxW(nullptr, msg, L"Invalid file path", MB_OK);
return false;
}
const wchar_t *unsupportedCharMsg = L"File name contains unsupported characters.";
for (size_t i = 0; i < fnLengthWithoutExt; i++)
{
if (fn[i] < static_cast<wchar_t>(0) || fn[i] >= static_cast<wchar_t>(128))
{
MessageBeep(MB_ICONERROR);
MessageBoxW(nullptr, unsupportedCharMsg, L"Invalid file path", MB_OK);
return false;
}
path[i] = static_cast<char>(fn[i]);
}
if (!ValidateFilePath(path, fnLengthWithoutExt))
{
MessageBeep(MB_ICONERROR);
MessageBoxW(nullptr, unsupportedCharMsg, L"Invalid file path", MB_OK);
return false;
}
outPathLength = fnLengthWithoutExt;
return true;
}
bool GpFileSystem_Win32::PromptOpenFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, char *path, size_t &outPathLength, size_t pathCapacity)
{
wchar_t baseFN[MAX_PATH + 5];
wchar_t baseDir[MAX_PATH + 5];
baseFN[0] = 0;
if (!ResolvePath(virtualDirectory, "", baseDir))
return false;
OPENFILENAMEW ofn;
memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFilter = GP_APPLICATION_NAME_W L" File (*.gpf)\0*.gpf\0";
ofn.lpstrFile = baseFN;
ofn.lpstrDefExt = L"gpf";
ofn.nMaxFile = MAX_PATH;
ofn.lpstrInitialDir = baseDir;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST;
ofn.hwndOwner = g_gpWindowsGlobals.m_hwnd;
if (!GetOpenFileNameW(&ofn))
return false;
if (ofn.Flags & OFN_EXTENSIONDIFFERENT)
{
MessageBeep(MB_ICONERROR);
MessageBoxW(nullptr, L"Open file failed: Files must have the '.gpf' extension", L"Invalid file path", MB_OK);
return false;
}
const wchar_t *fn = ofn.lpstrFile + ofn.nFileOffset;
size_t fnLengthWithoutExt = wcslen(fn);
if (ofn.nFileExtension - 1 > ofn.nFileOffset) // Off by 1 because extension doesn't include .
fnLengthWithoutExt = ofn.nFileExtension - ofn.nFileOffset - 1;
if (fnLengthWithoutExt >= pathCapacity)
{
wchar_t msg[256];
wsprintfW(msg, L"Open file failed: File name is too long. Limit is %i characters.", static_cast<int>(pathCapacity));
MessageBeep(MB_ICONERROR);
MessageBoxW(nullptr, msg, L"Invalid file path", MB_OK);
return false;
}
if (ofn.nFileOffset != wcslen(baseDir) || memcmp(ofn.lpstrFile, baseDir, ofn.nFileOffset * sizeof(wchar_t)))
{
wchar_t msg[256 + MAX_PATH];
wsprintfW(msg, L"Open file failed: File can't be opened from here, it must be in %s", baseDir);
MessageBeep(MB_ICONERROR);
MessageBoxW(nullptr, msg, L"Invalid file path", MB_OK);
return false;
}
const wchar_t *unsupportedCharMsg = L"File name contains unsupported characters.";
for (size_t i = 0; i < fnLengthWithoutExt; i++)
{
if (fn[i] < static_cast<wchar_t>(0) || fn[i] >= static_cast<wchar_t>(128))
{
MessageBeep(MB_ICONERROR);
MessageBoxW(nullptr, unsupportedCharMsg, L"Invalid file path", MB_OK);
return false;
}
path[i] = static_cast<char>(fn[i]);
}
if (!ValidateFilePath(path, fnLengthWithoutExt))
{
MessageBeep(MB_ICONERROR);
MessageBoxW(nullptr, unsupportedCharMsg, L"Invalid file path", MB_OK);
return false;
}
outPathLength = fnLengthWithoutExt;
return true;
}
bool GpFileSystem_Win32::ValidateFilePath(const char *str, size_t length) const
{
for (size_t i = 0; i < length; i++)
{
const char c = str[i];
if (c >= '0' && c <= '9')
continue;
if (c == '_' || c == '.' || c == '\'')
continue;
if (c == ' ' && i != 0 && i != length - 1)
continue;
if (c >= 'a' && c <= 'z')
continue;
if (c >= 'A' && c <= 'Z')
continue;
return false;
}
return true;
}
const wchar_t *GpFileSystem_Win32::GetBasePath() const
{
return m_executablePath;
}
GpFileSystem_Win32 *GpFileSystem_Win32::GetInstance()
{
return &ms_instance;
}
bool GpFileSystem_Win32::ResolvePath(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, wchar_t *outPath)
{
const wchar_t *baseDir = nullptr;
switch (virtualDirectory)
{
case PortabilityLayer::VirtualDirectories::kApplicationData:
baseDir = m_packagedDir.c_str();
break;
case PortabilityLayer::VirtualDirectories::kGameData:
baseDir = m_housesDir.c_str();
break;
case PortabilityLayer::VirtualDirectories::kUserData:
baseDir = m_userHousesDir.c_str();
break;
case PortabilityLayer::VirtualDirectories::kUserSaves:
baseDir = m_userSavesDir.c_str();
break;
case PortabilityLayer::VirtualDirectories::kPrefs:
baseDir = m_prefsDir.c_str();
break;
case PortabilityLayer::VirtualDirectories::kFonts:
baseDir = m_resourcesDir.c_str();
break;
case PortabilityLayer::VirtualDirectories::kHighScores:
baseDir = m_scoresDir.c_str();
break;
default:
return false;
}
if (baseDir == nullptr)
return false;
const size_t baseDirLen = wcslen(baseDir);
const size_t pathLen = strlen(path);
if (baseDirLen >= MAX_PATH || MAX_PATH - baseDirLen < pathLen)
return false;
memcpy(outPath, baseDir, sizeof(wchar_t) * baseDirLen);
for (size_t i = 0; i < pathLen; i++)
{
char c = path[i];
if (c == '/')
c = '\\';
outPath[baseDirLen + i] = static_cast<wchar_t>(c);
}
outPath[baseDirLen + pathLen] = static_cast<wchar_t>(0);
return true;
}
GpFileSystem_Win32 GpFileSystem_Win32::ms_instance;

View File

@@ -0,0 +1,43 @@
#pragma once
#include "HostFileSystem.h"
#include "GpCoreDefs.h"
#include "GpWindows.h"
#include <string>
class GpFileSystem_Win32 final : public PortabilityLayer::HostFileSystem
{
public:
GpFileSystem_Win32();
bool FileExists(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path) override;
bool FileLocked(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool *exists) override;
PortabilityLayer::IOStream *OpenFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool writeAccess, GpFileCreationDisposition_t createDisposition) override;
bool DeleteFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool &existed) override;
PortabilityLayer::HostDirectoryCursor *ScanDirectory(PortabilityLayer::VirtualDirectory_t virtualDirectory) override;
bool PromptSaveFile(PortabilityLayer::VirtualDirectory_t dirID, char *path, size_t &outPathLength, size_t pathCapacity, const char *initialFileName) override;
bool PromptOpenFile(PortabilityLayer::VirtualDirectory_t dirID, char *path, size_t &outPathLength, size_t pathCapacity) override;
bool ValidateFilePath(const char *path, size_t sz) const override;
const wchar_t *GetBasePath() const;
static GpFileSystem_Win32 *GetInstance();
private:
bool ResolvePath(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, wchar_t *outPath);
std::wstring m_prefsDir;
std::wstring m_scoresDir;
std::wstring m_packagedDir;
std::wstring m_housesDir;
std::wstring m_userHousesDir;
std::wstring m_userSavesDir;
std::wstring m_resourcesDir;
wchar_t m_executablePath[MAX_PATH];
static GpFileSystem_Win32 ms_instance;
};

View File

@@ -0,0 +1,9 @@
#include "GpFontHandlerFactory.h"
#include "GpFontHandler_FreeType2.h"
#include <stdlib.h>
PortabilityLayer::HostFontHandler *GpFontHandlerFactory::Create()
{
return GpFontHandler_FreeType2::Create();
}

View File

@@ -0,0 +1,12 @@
#pragma once
namespace PortabilityLayer
{
class HostFontHandler;
}
class GpFontHandlerFactory final
{
public:
static PortabilityLayer::HostFontHandler *Create();
};

View File

@@ -0,0 +1,425 @@
#include "GpFontHandler_FreeType2.h"
#include "CoreDefs.h"
#include "IOStream.h"
#include "HostFont.h"
#include "HostFontRenderedGlyph.h"
#include "RenderedGlyphMetrics.h"
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_MODULE_H
#include <stdint.h>
#include <stdlib.h>
#include <new>
#include <assert.h>
class GpFontRenderedGlyph_FreeType2 final : public PortabilityLayer::HostFontRenderedGlyph
{
public:
const PortabilityLayer::RenderedGlyphMetrics &GetMetrics() const override;
const void *GetData() const override;
void Destroy() override;
static GpFontRenderedGlyph_FreeType2 *Create(size_t dataSize, const PortabilityLayer::RenderedGlyphMetrics &metrics);
void *GetMutableData();
private:
GpFontRenderedGlyph_FreeType2(void *data, const PortabilityLayer::RenderedGlyphMetrics &metrics);
~GpFontRenderedGlyph_FreeType2();
void *m_data;
PortabilityLayer::RenderedGlyphMetrics m_metrics;
};
class GpFont_FreeType2 final : public PortabilityLayer::HostFont
{
public:
void Destroy() override;
GpFontRenderedGlyph_FreeType2 *Render(uint32_t unicodeCodePoint, unsigned int size, bool aa) override;
bool GetLineSpacing(unsigned int size, int32_t &outSpacing) override;
static GpFont_FreeType2 *Create(const FT_StreamRec_ &streamRec, PortabilityLayer::IOStream *stream);
bool FTLoad(const FT_Library &library);
private:
explicit GpFont_FreeType2(const FT_StreamRec_ &streamRec, PortabilityLayer::IOStream *stream);
~GpFont_FreeType2();
FT_StreamRec_ m_ftStream;
FT_Face m_face;
PortabilityLayer::IOStream *m_stream;
unsigned int m_currentSize;
};
const PortabilityLayer::RenderedGlyphMetrics &GpFontRenderedGlyph_FreeType2::GetMetrics() const
{
return m_metrics;
}
const void *GpFontRenderedGlyph_FreeType2::GetData() const
{
return m_data;
}
void GpFontRenderedGlyph_FreeType2::Destroy()
{
this->~GpFontRenderedGlyph_FreeType2();
free(this);
}
GpFontRenderedGlyph_FreeType2 *GpFontRenderedGlyph_FreeType2::Create(size_t dataSize, const PortabilityLayer::RenderedGlyphMetrics &metrics)
{
size_t alignedPrefixSize = (sizeof(GpFontRenderedGlyph_FreeType2) + GP_SYSTEM_MEMORY_ALIGNMENT - 1);
alignedPrefixSize -= alignedPrefixSize % GP_SYSTEM_MEMORY_ALIGNMENT;
void *storage = malloc(alignedPrefixSize + dataSize);
if (!storage)
return nullptr;
return new (storage) GpFontRenderedGlyph_FreeType2(static_cast<uint8_t*>(storage) + alignedPrefixSize, metrics);
}
void *GpFontRenderedGlyph_FreeType2::GetMutableData()
{
return m_data;
}
GpFontRenderedGlyph_FreeType2::GpFontRenderedGlyph_FreeType2(void *data, const PortabilityLayer::RenderedGlyphMetrics &metrics)
: m_metrics(metrics)
, m_data(data)
{
}
GpFontRenderedGlyph_FreeType2::~GpFontRenderedGlyph_FreeType2()
{
}
void GpFont_FreeType2::Destroy()
{
this->~GpFont_FreeType2();
free(this);
}
GpFontRenderedGlyph_FreeType2 *GpFont_FreeType2::Render(uint32_t unicodeCodePoint, unsigned int size, bool aa)
{
if (m_currentSize != size)
{
if (FT_Set_Pixel_Sizes(m_face, 0, size) != 0)
return nullptr;
m_currentSize = size;
}
FT_UInt glyphIndex = FT_Get_Char_Index(m_face, unicodeCodePoint);
if (!glyphIndex)
return nullptr;
FT_Int32 loadFlags = 0;
FT_Render_Mode renderMode = FT_RENDER_MODE_NORMAL;
if (aa)
{
renderMode = FT_RENDER_MODE_NORMAL;
loadFlags = FT_LOAD_TARGET_NORMAL;
}
else
{
loadFlags = FT_LOAD_MONOCHROME | FT_LOAD_TARGET_MONO;
renderMode = FT_RENDER_MODE_MONO;
}
if (FT_Load_Glyph(m_face, glyphIndex, loadFlags) != 0)
return nullptr;
if (FT_Render_Glyph(m_face->glyph, renderMode) != 0)
return nullptr;
const FT_GlyphSlot glyph = m_face->glyph;
if (aa == false && glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO)
return nullptr;
if (aa == true)
{
if (glyph->bitmap.pixel_mode != FT_PIXEL_MODE_GRAY)
return nullptr;
if (glyph->bitmap.num_grays < 2)
return nullptr; // This should never happen
}
PortabilityLayer::RenderedGlyphMetrics metrics;
memset(&metrics, 0, sizeof(metrics));
metrics.m_bearingX = glyph->metrics.horiBearingX / 64;
metrics.m_bearingY = glyph->metrics.horiBearingY / 64;
metrics.m_glyphWidth = glyph->bitmap.width;
metrics.m_glyphHeight = glyph->bitmap.rows;
metrics.m_advanceX = glyph->metrics.horiAdvance / 64;
const size_t numRowsRequired = glyph->bitmap.rows;
size_t pitchRequired = 0;
if (aa)
pitchRequired = (glyph->bitmap.width + 1) / 2;
else
pitchRequired = (glyph->bitmap.width + 7) / 8;
pitchRequired = pitchRequired + (GP_SYSTEM_MEMORY_ALIGNMENT - 1);
pitchRequired -= pitchRequired % GP_SYSTEM_MEMORY_ALIGNMENT;
const size_t glyphDataSize = numRowsRequired * pitchRequired;
metrics.m_glyphDataPitch = pitchRequired;
GpFontRenderedGlyph_FreeType2 *renderedGlyph = GpFontRenderedGlyph_FreeType2::Create(glyphDataSize, metrics);
if (!renderedGlyph)
return nullptr;
uint8_t *fillData = static_cast<uint8_t*>(renderedGlyph->GetMutableData());
unsigned int bmWidth = glyph->bitmap.width;
unsigned int bmHeight = glyph->bitmap.rows;
unsigned int bmPitch = glyph->bitmap.pitch;
const uint8_t *bmBytes = glyph->bitmap.buffer;
const uint16_t numGrays = glyph->bitmap.num_grays;
size_t fillOffset = 0;
for (unsigned int row = 0; row < bmHeight; row++)
{
const uint8_t *bmReadStart = bmBytes + bmPitch * row;
uint8_t *bmWriteStart = fillData + pitchRequired * row;
if (aa)
{
for (size_t i = 0; i < pitchRequired; i++)
bmWriteStart[i] = 0;
for (size_t i = 0; i < bmWidth; i++)
{
const uint8_t b = bmReadStart[i];
const uint8_t normalizedGray = (b * 30 + (numGrays - 1)) / ((numGrays - 1) * 2);
if (i & 1)
bmWriteStart[i / 2] |= (normalizedGray << 4);
else
bmWriteStart[i / 2] = normalizedGray;
}
}
else
{
const size_t copyableBytesPerRow = (glyph->bitmap.width + 7) / 8;
for (size_t i = 0; i < copyableBytesPerRow; i++)
{
const uint8_t b = bmReadStart[i];
uint8_t fillByte = 0;
for (int bit = 0; bit < 8; bit++)
fillByte |= ((b >> (7 - bit)) & 1) << bit;
bmWriteStart[i] = fillByte;
}
}
}
return renderedGlyph;
}
bool GpFont_FreeType2::GetLineSpacing(unsigned int size, int32_t &outSpacing)
{
if (m_currentSize != size)
{
if (FT_Set_Pixel_Sizes(m_face, 0, size) != 0)
return false;
m_currentSize = size;
}
outSpacing = m_face->size->metrics.height / 64;
return true;
}
GpFont_FreeType2 *GpFont_FreeType2::Create(const FT_StreamRec_ &streamRec, PortabilityLayer::IOStream *stream)
{
void *storage = malloc(sizeof(GpFont_FreeType2));
if (!storage)
return nullptr;
return new (storage) GpFont_FreeType2(streamRec, stream);
}
bool GpFont_FreeType2::FTLoad(const FT_Library &library)
{
FT_Open_Args openArgs;
memset(&openArgs, 0, sizeof(openArgs));
openArgs.flags = FT_OPEN_STREAM;
openArgs.stream = &m_ftStream;
FT_Error errorCode = FT_Open_Face(library, &openArgs, 0, &m_face);
if (errorCode != 0)
return false;
return true;
}
GpFont_FreeType2::GpFont_FreeType2(const FT_StreamRec_ &streamRec, PortabilityLayer::IOStream *stream)
: m_face(nullptr)
, m_ftStream(streamRec)
, m_stream(stream)
, m_currentSize(0)
{
assert(stream);
}
GpFont_FreeType2::~GpFont_FreeType2()
{
if (m_face)
FT_Done_Face(m_face);
m_stream->Close();
}
GpFontHandler_FreeType2 *GpFontHandler_FreeType2::Create()
{
void *storage = malloc(sizeof(GpFontHandler_FreeType2));
if (!storage)
return nullptr;
GpFontHandler_FreeType2 *fh = new (storage) GpFontHandler_FreeType2();
if (!fh->Init())
{
fh->Shutdown();
return nullptr;
}
return fh;
}
PortabilityLayer::HostFont *GpFontHandler_FreeType2::LoadFont(PortabilityLayer::IOStream *stream)
{
FT_StreamRec_ ftStream;
memset(&ftStream, 0, sizeof(ftStream));
ftStream.size = 0x7fffffff;
ftStream.pos = 0;
ftStream.descriptor.pointer = stream;
ftStream.read = FTStreamIo;
ftStream.close = FTStreamClose;
GpFont_FreeType2 *font = GpFont_FreeType2::Create(ftStream, stream);
if (!font)
{
stream->Close();
return nullptr;
}
if (!font->FTLoad(m_library))
{
font->Destroy();
return nullptr;
}
return font;
}
bool GpFontHandler_FreeType2::KeepStreamOpen() const
{
return true;
}
void GpFontHandler_FreeType2::Shutdown()
{
this->~GpFontHandler_FreeType2();
free(this);
}
GpFontHandler_FreeType2::GpFontHandler_FreeType2()
: m_ftIsInitialized(false)
, m_library(nullptr)
, m_currentSize(0)
{
}
GpFontHandler_FreeType2::~GpFontHandler_FreeType2()
{
if (m_ftIsInitialized)
FT_Done_Library(m_library);
}
void *GpFontHandler_FreeType2::FTAllocThunk(FT_Memory memory, long size)
{
return static_cast<GpFontHandler_FreeType2*>(memory->user)->FTAlloc(size);
}
void GpFontHandler_FreeType2::FTFreeThunk(FT_Memory memory, void* block)
{
static_cast<GpFontHandler_FreeType2*>(memory->user)->FTFree(block);
}
void *GpFontHandler_FreeType2::FTReallocThunk(FT_Memory memory, long curSize, long newSize, void *block)
{
return static_cast<GpFontHandler_FreeType2*>(memory->user)->FTRealloc(curSize, newSize, block);
}
unsigned long GpFontHandler_FreeType2::FTStreamIo(FT_Stream stream, unsigned long offset, unsigned char* buffer, unsigned long count)
{
PortabilityLayer::IOStream *ioStream = static_cast<PortabilityLayer::IOStream*>(stream->descriptor.pointer);
if (count == 0)
{
if (!ioStream->SeekStart(static_cast<PortabilityLayer::UFilePos_t>(offset)))
return 1;
return 0;
}
const size_t bytesRead = ioStream->Read(buffer, count);
return static_cast<unsigned long>(bytesRead);
}
void GpFontHandler_FreeType2::FTStreamClose(FT_Stream stream)
{
(void)stream;
}
void *GpFontHandler_FreeType2::FTAlloc(long size)
{
return malloc(static_cast<size_t>(size));
}
void GpFontHandler_FreeType2::FTFree(void* block)
{
free(block);
}
void *GpFontHandler_FreeType2::FTRealloc(long curSize, long newSize, void *block)
{
(void)curSize;
return realloc(block, static_cast<size_t>(newSize));
}
bool GpFontHandler_FreeType2::Init()
{
m_mem.user = this;
m_mem.alloc = FTAllocThunk;
m_mem.free = FTFreeThunk;
m_mem.realloc = FTReallocThunk;
if (FT_New_Library(&m_mem, &m_library) != 0)
return false;
m_ftIsInitialized = true;
FT_Add_Default_Modules(m_library);
return true;
}

View File

@@ -0,0 +1,46 @@
#pragma once
#include "HostFontHandler.h"
#include <ft2build.h>
#include FT_SYSTEM_H
#include FT_FREETYPE_H
namespace PortabilityLayer
{
class IOStream;
class HostFont;
}
class GpFontHandler_FreeType2 final : public PortabilityLayer::HostFontHandler
{
public:
PortabilityLayer::HostFont *LoadFont(PortabilityLayer::IOStream *stream) override;
void Shutdown() override;
bool KeepStreamOpen() const override;
static GpFontHandler_FreeType2 *Create();
private:
GpFontHandler_FreeType2();
~GpFontHandler_FreeType2();
static void *FTAllocThunk(FT_Memory memory, long size);
static void FTFreeThunk(FT_Memory memory, void* block);
static void *FTReallocThunk(FT_Memory memory, long curSize, long newSize, void *block);
static unsigned long FTStreamIo(FT_Stream stream, unsigned long offset, unsigned char* buffer, unsigned long count);
static void FTStreamClose(FT_Stream stream);
void *FTAlloc(long size);
void FTFree(void* block);
void *FTRealloc(long curSize, long newSize, void *block);
bool Init();
FT_MemoryRec_ m_mem;
FT_Library m_library;
unsigned int m_currentSize;
bool m_ftIsInitialized;
};

View File

@@ -0,0 +1,3 @@
#include "GpGlobalConfig.h"
GpGlobalConfig g_gpGlobalConfig;

17
Aerofoil/GpGlobalConfig.h Normal file
View File

@@ -0,0 +1,17 @@
#pragma once
#include "EGpDisplayDriverType.h"
#include "EGpAudioDriverType.h"
#include "EGpInputDriverType.h"
struct GpGlobalConfig
{
EGpDisplayDriverType m_displayDriverType;
EGpAudioDriverType m_audioDriverType;
const EGpInputDriverType *m_inputDriverTypes;
size_t m_numInputDrivers;
void *m_osGlobals;
};
extern GpGlobalConfig g_gpGlobalConfig;

View File

@@ -0,0 +1,23 @@
#include "GpInputDriverFactory.h"
#include "GpInputDriverProperties.h"
#include <assert.h>
IGpInputDriver *GpInputDriverFactory::CreateInputDriver(const GpInputDriverProperties &properties)
{
assert(properties.m_type < EGpInputDriverType_Count);
if (ms_registry[properties.m_type])
return ms_registry[properties.m_type](properties);
else
return nullptr;
}
void GpInputDriverFactory::RegisterInputDriverFactory(EGpInputDriverType type, FactoryFunc_t func)
{
assert(type < EGpInputDriverType_Count);
ms_registry[type] = func;
}
GpInputDriverFactory::FactoryFunc_t GpInputDriverFactory::ms_registry[EGpInputDriverType_Count];

View File

@@ -0,0 +1,18 @@
#pragma once
#include "EGpInputDriverType.h"
struct IGpInputDriver;
struct GpInputDriverProperties;
class GpInputDriverFactory
{
public:
typedef IGpInputDriver *(*FactoryFunc_t)(const GpInputDriverProperties &properties);
static IGpInputDriver *CreateInputDriver(const GpInputDriverProperties &properties);
static void RegisterInputDriverFactory(EGpInputDriverType type, FactoryFunc_t func);
private:
static FactoryFunc_t ms_registry[EGpInputDriverType_Count];
};

125
Aerofoil/GpMain.cpp Normal file
View File

@@ -0,0 +1,125 @@
#include "GpMain.h"
#include "GpAudioDriverFactory.h"
#include "GpAudioDriverProperties.h"
#include "GpFontHandlerFactory.h"
#include "GpDisplayDriverFactory.h"
#include "GpDisplayDriverProperties.h"
#include "GpDisplayDriverTickStatus.h"
#include "GpInputDriverFactory.h"
#include "GpInputDriverProperties.h"
#include "GpGlobalConfig.h"
#include "GpAppEnvironment.h"
#include "IGpAudioDriver.h"
#include "IGpDisplayDriver.h"
#include "IGpInputDriver.h"
#include <string.h>
#include <stdlib.h>
namespace
{
GpDisplayDriverTickStatus_t TickAppEnvironment(void *context, IGpFiber *vosFiber)
{
return static_cast<GpAppEnvironment*>(context)->Tick(vosFiber);
}
void RenderAppEnvironment(void *context)
{
static_cast<GpAppEnvironment*>(context)->Render();
}
bool AdjustRequestedResolution(void *context, uint32_t &physicalWidth, uint32_t &physicalHeight, uint32_t &virtualWidth, uint32_t &virtualheight, float &pixelScaleX, float &pixelScaleY)
{
return static_cast<GpAppEnvironment*>(context)->AdjustRequestedResolution(physicalWidth, physicalHeight, virtualWidth, virtualheight, pixelScaleX, pixelScaleY);
}
}
int GpMain::Run()
{
GpVOSEventQueue *eventQueue = new GpVOSEventQueue();
GpAppEnvironment *appEnvironment = new GpAppEnvironment();
GpDisplayDriverProperties ddProps;
memset(&ddProps, 0, sizeof(ddProps));
ddProps.m_frameTimeLockNumerator = 1;
ddProps.m_frameTimeLockDenominator = 60;
// +/- 1% tolerance for frame time variance
ddProps.m_frameTimeLockMinNumerator = 99;
ddProps.m_frameTimeLockMinDenominator = 6000;
ddProps.m_frameTimeLockMaxNumerator = 101;
ddProps.m_frameTimeLockMaxDenominator = 6000;
ddProps.m_tickFunc = TickAppEnvironment;
ddProps.m_tickFuncContext = appEnvironment;
ddProps.m_renderFunc = RenderAppEnvironment;
ddProps.m_renderFuncContext = appEnvironment;
ddProps.m_adjustRequestedResolutionFunc = AdjustRequestedResolution;
ddProps.m_adjustRequestedResolutionFuncContext = appEnvironment;
ddProps.m_type = g_gpGlobalConfig.m_displayDriverType;
ddProps.m_osGlobals = g_gpGlobalConfig.m_osGlobals;
ddProps.m_eventQueue = eventQueue;
GpAudioDriverProperties adProps;
memset(&adProps, 0, sizeof(adProps));
// The sample rate used in all of Glider PRO's sound is 0x56ee8ba3
// This appears to be the "standard" Mac sample rate, probably rounded from 244800/11.
adProps.m_type = g_gpGlobalConfig.m_audioDriverType;
adProps.m_sampleRate = (244800 * 2 + 11) / (11 * 2);
#ifdef NDEBUG
adProps.m_debug = true;
#else
adProps.m_debug = false;
#endif
IGpInputDriver **inputDrivers = static_cast<IGpInputDriver**>(malloc(sizeof(IGpInputDriver*) * g_gpGlobalConfig.m_numInputDrivers));
size_t numCreatedInputDrivers = 0;
if (inputDrivers)
{
for (size_t i = 0; i < g_gpGlobalConfig.m_numInputDrivers; i++)
{
GpInputDriverProperties inputProps;
memset(&inputProps, 0, sizeof(inputProps));
inputProps.m_type = g_gpGlobalConfig.m_inputDriverTypes[i];
inputProps.m_eventQueue = eventQueue;
if (IGpInputDriver *driver = GpInputDriverFactory::CreateInputDriver(inputProps))
inputDrivers[numCreatedInputDrivers++] = driver;
}
}
IGpDisplayDriver *displayDriver = GpDisplayDriverFactory::CreateDisplayDriver(ddProps);
IGpAudioDriver *audioDriver = GpAudioDriverFactory::CreateAudioDriver(adProps);
PortabilityLayer::HostFontHandler *fontHandler = GpFontHandlerFactory::Create();
appEnvironment->Init();
appEnvironment->SetDisplayDriver(displayDriver);
appEnvironment->SetAudioDriver(audioDriver);
appEnvironment->SetInputDrivers(inputDrivers, numCreatedInputDrivers);
appEnvironment->SetFontHandler(fontHandler);
appEnvironment->SetVOSEventQueue(eventQueue);
// Start the display loop
displayDriver->Run();
// Clean up
if (inputDrivers)
{
for (size_t i = 0; i < numCreatedInputDrivers; i++)
inputDrivers[i]->Shutdown();
free(inputDrivers);
}
// GP TODO: Cleanup
return 0;
}

6
Aerofoil/GpMain.h Normal file
View File

@@ -0,0 +1,6 @@
#pragma once
namespace GpMain
{
int Run();
}

427
Aerofoil/GpMain_Win32.cpp Normal file
View File

@@ -0,0 +1,427 @@
#include "GpMain.h"
#include "GpAudioDriverFactory.h"
#include "GpCursor_Win32.h"
#include "GpDisplayDriverFactory.h"
#include "GpGlobalConfig.h"
#include "GpFiber_Win32.h"
#include "GpFileSystem_Win32.h"
#include "GpInputDriverFactory.h"
#include "GpAppInterface.h"
#include "GpSystemServices_Win32.h"
#include "GpVOSEvent.h"
#include "IGpVOSEventQueue.h"
#include "HostFileSystem.h"
#include "GpWindows.h"
#include <stdio.h>
#include <windowsx.h>
GpWindowsGlobals g_gpWindowsGlobals;
extern "C" __declspec(dllimport) IGpAudioDriver *GpDriver_CreateAudioDriver_XAudio2(const GpAudioDriverProperties &properties);
extern "C" __declspec(dllimport) IGpDisplayDriver *GpDriver_CreateDisplayDriver_D3D11(const GpDisplayDriverProperties &properties);
extern "C" __declspec(dllimport) IGpInputDriver *GpDriver_CreateInputDriver_XInput(const GpInputDriverProperties &properties);
static void PostMouseEvent(IGpVOSEventQueue *eventQueue, GpMouseEventType_t eventType, GpMouseButton_t button, int32_t x, int32_t y, float pixelScaleX, float pixelScaleY)
{
if (GpVOSEvent *evt = eventQueue->QueueEvent())
{
evt->m_eventType = GpVOSEventTypes::kMouseInput;
GpMouseInputEvent &mEvent = evt->m_event.m_mouseInputEvent;
mEvent.m_button = button;
mEvent.m_x = x;
mEvent.m_y = y;
mEvent.m_eventType = eventType;
if (pixelScaleX != 1.0f)
mEvent.m_x = static_cast<int32_t>(static_cast<float>(x) / pixelScaleX);
if (pixelScaleY != 1.0f)
mEvent.m_y = static_cast<int32_t>(static_cast<float>(y) / pixelScaleX);
}
}
static bool IdentifyVKey(const WPARAM &wparam, const LPARAM &lparam, GpKeyIDSubset_t &outSubset, GpKeyboardInputEvent::KeyUnion &outKey)
{
switch (wparam)
{
case VK_ESCAPE:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kEscape;
break;
case VK_PRINT:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kPrintScreen;
break;
case VK_SCROLL:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kScrollLock;
break;
case VK_PAUSE:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kPause;
break;
case VK_INSERT:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kInsert;
break;
case VK_HOME:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kHome;
break;
case VK_PRIOR:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kPageUp;
break;
case VK_NEXT:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kPageDown;
break;
case VK_DELETE:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kDelete;
break;
case VK_TAB:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kTab;
break;
case VK_END:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kEnd;
break;
case VK_BACK:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kBackspace;
break;
case VK_CAPITAL:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kCapsLock;
break;
case VK_RETURN:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kEnter;
break;
case VK_SHIFT:
{
UINT vkey = MapVirtualKeyW((lparam >> 16) & 0xff, MAPVK_VSC_TO_VK_EX);
if (vkey == VK_LSHIFT || vkey == VK_SHIFT)
{
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kLeftShift;
}
else if (vkey == VK_RSHIFT)
{
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kRightShift;
}
else
return false;
}
break;
case VK_RSHIFT:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kRightShift;
break;
case VK_CONTROL:
outSubset = GpKeyIDSubsets::kSpecial;
if (lparam & 0x01000000)
outKey.m_specialKey = GpKeySpecials::kRightCtrl;
else
outKey.m_specialKey = GpKeySpecials::kLeftCtrl;
break;
case VK_MENU:
outSubset = GpKeyIDSubsets::kSpecial;
if (lparam & 0x01000000)
outKey.m_specialKey = GpKeySpecials::kRightAlt;
else
outKey.m_specialKey = GpKeySpecials::kLeftAlt;
break;
case VK_NUMLOCK:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kNumLock;
break;
case VK_NUMPAD0:
case VK_NUMPAD1:
case VK_NUMPAD2:
case VK_NUMPAD3:
case VK_NUMPAD4:
case VK_NUMPAD5:
case VK_NUMPAD6:
case VK_NUMPAD7:
case VK_NUMPAD8:
case VK_NUMPAD9:
outSubset = GpKeyIDSubsets::kNumPadNumber;
outKey.m_numPadNumber = static_cast<uint8_t>(wparam - VK_NUMPAD0);
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
outSubset = GpKeyIDSubsets::kASCII;
outKey.m_asciiChar = static_cast<char>(wparam);
break;
case VK_F1:
case VK_F2:
case VK_F3:
case VK_F4:
case VK_F5:
case VK_F6:
case VK_F7:
case VK_F8:
case VK_F9:
case VK_F10:
case VK_F11:
case VK_F12:
case VK_F13:
case VK_F14:
case VK_F15:
case VK_F16:
case VK_F17:
case VK_F18:
case VK_F19:
case VK_F20:
case VK_F21:
case VK_F22:
case VK_F23:
case VK_F24:
outSubset = GpKeyIDSubsets::kFKey;
outKey.m_fKey = static_cast<uint8_t>(wparam - VK_F1 + 1);
break;
case VK_OEM_COMMA:
outSubset = GpKeyIDSubsets::kASCII;
outKey.m_asciiChar = ',';
break;
case VK_OEM_MINUS:
outSubset = GpKeyIDSubsets::kASCII;
outKey.m_asciiChar = '-';
break;
case VK_OEM_PERIOD:
outSubset = GpKeyIDSubsets::kASCII;
outKey.m_asciiChar = '.';
break;
case VK_OEM_PLUS:
outSubset = GpKeyIDSubsets::kASCII;
outKey.m_asciiChar = '+';
break;
case VK_UP:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kUpArrow;
break;
case VK_DOWN:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kDownArrow;
break;
case VK_LEFT:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kLeftArrow;
break;
case VK_RIGHT:
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kRightArrow;
break;
default:
{
if (wparam >= VK_OEM_1 && wparam <= VK_OEM_102)
{
UINT charCode = MapVirtualKeyW(static_cast<UINT>(wparam), MAPVK_VK_TO_CHAR);
if (charCode == 0)
return false;
if (charCode < 128)
{
outSubset = GpKeyIDSubsets::kASCII;
outKey.m_asciiChar = static_cast<char>(charCode);
break;
}
else
{
outSubset = GpKeyIDSubsets::kUnicode;
outKey.m_unicodeChar = charCode;;
break;
}
}
}
return false;
}
return true;
}
static void PostKeyboardEvent(IGpVOSEventQueue *eventQueue, GpKeyboardInputEventType_t eventType, GpKeyIDSubset_t subset, const GpKeyboardInputEvent::KeyUnion &key, uint32_t repeatCount)
{
if (GpVOSEvent *evt = eventQueue->QueueEvent())
{
evt->m_eventType = GpVOSEventTypes::kKeyboardInput;
GpKeyboardInputEvent &mEvent = evt->m_event.m_keyboardInputEvent;
mEvent.m_key = key;
mEvent.m_eventType = eventType;
mEvent.m_keyIDSubset = subset;
mEvent.m_repeatCount = repeatCount;
}
}
static void TranslateWindowsMessage(const MSG *msg, IGpVOSEventQueue *eventQueue, float pixelScaleX, float pixelScaleY)
{
WPARAM wParam = msg->wParam;
LPARAM lParam = msg->lParam;
switch (msg->message)
{
case WM_LBUTTONDOWN:
PostMouseEvent(eventQueue, GpMouseEventTypes::kDown, GpMouseButtons::kLeft, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), pixelScaleX, pixelScaleY);
break;
case WM_LBUTTONUP:
PostMouseEvent(eventQueue, GpMouseEventTypes::kUp, GpMouseButtons::kLeft, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), pixelScaleX, pixelScaleY);
break;
case WM_MBUTTONDOWN:
PostMouseEvent(eventQueue, GpMouseEventTypes::kDown, GpMouseButtons::kMiddle, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), pixelScaleX, pixelScaleY);
break;
case WM_MBUTTONUP:
PostMouseEvent(eventQueue, GpMouseEventTypes::kUp, GpMouseButtons::kMiddle, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), pixelScaleX, pixelScaleY);
break;
case WM_RBUTTONDOWN:
PostMouseEvent(eventQueue, GpMouseEventTypes::kDown, GpMouseButtons::kRight, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), pixelScaleX, pixelScaleY);
break;
case WM_RBUTTONUP:
PostMouseEvent(eventQueue, GpMouseEventTypes::kUp, GpMouseButtons::kRight, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), pixelScaleX, pixelScaleY);
break;
case WM_XBUTTONDOWN:
if (GET_XBUTTON_WPARAM(wParam) == XBUTTON1)
PostMouseEvent(eventQueue, GpMouseEventTypes::kDown, GpMouseButtons::kX1, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), pixelScaleX, pixelScaleY);
else if (GET_XBUTTON_WPARAM(wParam) == XBUTTON2)
PostMouseEvent(eventQueue, GpMouseEventTypes::kDown, GpMouseButtons::kX2, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), pixelScaleX, pixelScaleY);
break;
case WM_XBUTTONUP:
if (GET_XBUTTON_WPARAM(wParam) == XBUTTON1)
PostMouseEvent(eventQueue, GpMouseEventTypes::kUp, GpMouseButtons::kX1, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), pixelScaleX, pixelScaleY);
else if (GET_XBUTTON_WPARAM(wParam) == XBUTTON2)
PostMouseEvent(eventQueue, GpMouseEventTypes::kUp, GpMouseButtons::kX2, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), pixelScaleX, pixelScaleY);
break;
case WM_MOUSEMOVE:
PostMouseEvent(eventQueue, GpMouseEventTypes::kMove, GpMouseButtons::kNone, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), pixelScaleX, pixelScaleY);
break;
case WM_MOUSELEAVE:
PostMouseEvent(eventQueue, GpMouseEventTypes::kLeave, GpMouseButtons::kNone, 0, 0, pixelScaleX, pixelScaleY);
break;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
{
GpKeyIDSubset_t subset;
GpKeyboardInputEvent::KeyUnion key;
bool isRepeat = ((lParam & 0x40000000) != 0);
const GpKeyboardInputEventType_t keyEventType = isRepeat ? GpKeyboardInputEventTypes::kAuto : GpKeyboardInputEventTypes::kDown;
if (IdentifyVKey(wParam, lParam, subset, key))
PostKeyboardEvent(eventQueue, keyEventType, subset, key, static_cast<uint32_t>(lParam & 0xffff));
(void)TranslateMessage(msg);
}
break;
case WM_KEYUP:
case WM_SYSKEYUP:
{
GpKeyIDSubset_t subset;
GpKeyboardInputEvent::KeyUnion key;
if (IdentifyVKey(wParam, lParam, subset, key))
PostKeyboardEvent(eventQueue, GpKeyboardInputEventTypes::kUp, subset, key, (lParam & 0xffff));
}
break;
case WM_CHAR:
case WM_UNICHAR:
{
bool isRepeat = ((lParam & 0x4000000) != 0);
const GpKeyboardInputEventType_t keyEventType = isRepeat ? GpKeyboardInputEventTypes::kAutoChar : GpKeyboardInputEventTypes::kDownChar;
GpKeyboardInputEvent::KeyUnion key;
GpKeyIDSubset_t subset = GpKeyIDSubsets::kASCII;
if (wParam <= 128)
key.m_asciiChar = static_cast<char>(wParam);
else
{
subset = GpKeyIDSubsets::kUnicode;
key.m_unicodeChar = static_cast<uint32_t>(wParam);
}
PostKeyboardEvent(eventQueue, keyEventType, subset, key, (lParam & 0xffff));
}
break;
case WM_QUIT:
{
if (GpVOSEvent *evt = eventQueue->QueueEvent())
evt->m_eventType = GpVOSEventTypes::kQuit;
}
break;
default:
break;
}
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
GpAppInterface_Get()->PL_HostFileSystem_SetInstance(GpFileSystem_Win32::GetInstance());
GpAppInterface_Get()->PL_HostSystemServices_SetInstance(GpSystemServices_Win32::GetInstance());
g_gpWindowsGlobals.m_hInstance = hInstance;
g_gpWindowsGlobals.m_hPrevInstance = hPrevInstance;
g_gpWindowsGlobals.m_cmdLine = lpCmdLine;
g_gpWindowsGlobals.m_nCmdShow = nCmdShow;
g_gpWindowsGlobals.m_baseDir = GpFileSystem_Win32::GetInstance()->GetBasePath();
g_gpWindowsGlobals.m_hwnd = nullptr;
g_gpWindowsGlobals.m_createFiberFunc = GpFiber_Win32::Create;
g_gpWindowsGlobals.m_loadCursorFunc = GpCursor_Win32::Load;
g_gpWindowsGlobals.m_translateWindowsMessageFunc = TranslateWindowsMessage;
g_gpGlobalConfig.m_displayDriverType = EGpDisplayDriverType_D3D11;
g_gpGlobalConfig.m_audioDriverType = EGpAudioDriverType_XAudio2;
EGpInputDriverType inputDrivers[] =
{
EGpInputDriverType_XInput
};
g_gpGlobalConfig.m_inputDriverTypes = inputDrivers;
g_gpGlobalConfig.m_numInputDrivers = sizeof(inputDrivers) / sizeof(inputDrivers[0]);
g_gpGlobalConfig.m_osGlobals = &g_gpWindowsGlobals;
GpDisplayDriverFactory::RegisterDisplayDriverFactory(EGpDisplayDriverType_D3D11, GpDriver_CreateDisplayDriver_D3D11);
GpAudioDriverFactory::RegisterAudioDriverFactory(EGpAudioDriverType_XAudio2, GpDriver_CreateAudioDriver_XAudio2);
GpInputDriverFactory::RegisterInputDriverFactory(EGpInputDriverType_XInput, GpDriver_CreateInputDriver_XInput);
return GpMain::Run();
}

View File

@@ -0,0 +1,49 @@
#include "GpMemoryBuffer.h"
#include <new>
void *GpMemoryBuffer::Contents()
{
return reinterpret_cast<uint8_t*>(this) + AlignedSize();
}
size_t GpMemoryBuffer::Size()
{
return m_size;
}
void GpMemoryBuffer::Destroy()
{
delete[] reinterpret_cast<uint8_t*>(this);
}
GpMemoryBuffer *GpMemoryBuffer::Create(size_t sz)
{
const size_t allowedSize = SIZE_MAX - AlignedSize();
if (sz > allowedSize)
return nullptr;
const size_t bufferSize = GpMemoryBuffer::AlignedSize() + sz;
uint8_t *buffer = new uint8_t[bufferSize];
new (buffer) GpMemoryBuffer(sz);
return reinterpret_cast<GpMemoryBuffer*>(buffer);
}
GpMemoryBuffer::GpMemoryBuffer(size_t sz)
: m_size(sz)
{
}
GpMemoryBuffer::~GpMemoryBuffer()
{
}
size_t GpMemoryBuffer::AlignedSize()
{
const size_t paddedSize = (sizeof(GpMemoryBuffer) + GP_SYSTEM_MEMORY_ALIGNMENT - 1);
const size_t sz = paddedSize - paddedSize % GP_SYSTEM_MEMORY_ALIGNMENT;
return sz;
}

21
Aerofoil/GpMemoryBuffer.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#include "HostMemoryBuffer.h"
class GpMemoryBuffer final : public PortabilityLayer::HostMemoryBuffer
{
public:
void *Contents() override;
size_t Size() override;
void Destroy() override;
static GpMemoryBuffer *Create(size_t sz);
private:
explicit GpMemoryBuffer(size_t sz);
~GpMemoryBuffer();
static size_t AlignedSize();
size_t m_size;
};

View File

@@ -0,0 +1,42 @@
#include "GpMutex_Win32.h"
#include "GpWindows.h"
#include <stdlib.h>
#include <new>
void GpMutex_Win32::Destroy()
{
this->~GpMutex_Win32();
free(this);
}
void GpMutex_Win32::Lock()
{
EnterCriticalSection(&m_critSection);
}
void GpMutex_Win32::Unlock()
{
LeaveCriticalSection(&m_critSection);
}
GpMutex_Win32 *GpMutex_Win32::Create()
{
void *storage = malloc(sizeof(GpMutex_Win32));
if (!storage)
return nullptr;
return new (storage) GpMutex_Win32();
}
GpMutex_Win32::GpMutex_Win32()
{
InitializeCriticalSection(&m_critSection);
}
GpMutex_Win32::~GpMutex_Win32()
{
DeleteCriticalSection(&m_critSection);
}

21
Aerofoil/GpMutex_Win32.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#include "HostMutex.h"
#include "GpWindows.h"
class GpMutex_Win32 final : public PortabilityLayer::HostMutex
{
public:
void Destroy() override;
void Lock() override;
void Unlock() override;
static GpMutex_Win32 *Create();
private:
const GpMutex_Win32();
~GpMutex_Win32();
CRITICAL_SECTION m_critSection;
};

View File

@@ -0,0 +1,91 @@
#include "GpSystemServices_Win32.h"
#include "GpMutex_Win32.h"
#include "GpThreadEvent_Win32.h"
#include <assert.h>
#pragma push_macro("CreateMutex")
#ifdef CreateMutex
#undef CreateMutex
#endif
GpSystemServices_Win32::GpSystemServices_Win32()
{
}
int64_t GpSystemServices_Win32::GetTime() const
{
SYSTEMTIME epochStart;
epochStart.wYear = 1904;
epochStart.wMonth = 1;
epochStart.wDayOfWeek = 5;
epochStart.wDay = 1;
epochStart.wHour = 0;
epochStart.wMinute = 0;
epochStart.wSecond = 0;
epochStart.wMilliseconds = 0;
FILETIME epochStartFT;
if (!SystemTimeToFileTime(&epochStart, &epochStartFT))
return 0;
FILETIME currentTime;
GetSystemTimeAsFileTime(&currentTime);
int64_t epochStart64 = (static_cast<int64_t>(epochStartFT.dwLowDateTime) & 0xffffffff) | (static_cast<int64_t>(epochStartFT.dwHighDateTime) << 32);
int64_t currentTime64 = (static_cast<int64_t>(currentTime.dwLowDateTime) & 0xffffffff) | (static_cast<int64_t>(currentTime.dwHighDateTime) << 32);
return (currentTime64 - epochStart64) / 10000000;
}
void GpSystemServices_Win32::GetLocalDateTime(unsigned int &year, unsigned int &month, unsigned int &day, unsigned int &hour, unsigned int &minute, unsigned int &second) const
{
SYSTEMTIME localTime;
GetLocalTime(&localTime);
year = localTime.wYear;
month = localTime.wMonth;
day = localTime.wDay;
hour = localTime.wHour;
minute = localTime.wMinute;
second = localTime.wSecond;
}
PortabilityLayer::HostMutex *GpSystemServices_Win32::CreateMutex()
{
return GpMutex_Win32::Create();
}
PortabilityLayer::HostThreadEvent *GpSystemServices_Win32::CreateThreadEvent(bool autoReset, bool startSignaled)
{
return GpThreadEvent_Win32::Create(autoReset, startSignaled);
}
uint64_t GpSystemServices_Win32::GetFreeMemoryCosmetic() const
{
MEMORYSTATUSEX memStatus;
memset(&memStatus, 0, sizeof(memStatus));
memStatus.dwLength = sizeof(memStatus);
if (!GlobalMemoryStatusEx(&memStatus))
return 0;
return memStatus.ullAvailPhys;
}
void GpSystemServices_Win32::Beep() const
{
MessageBeep(MB_OK);
}
GpSystemServices_Win32 *GpSystemServices_Win32::GetInstance()
{
return &ms_instance;
}
GpSystemServices_Win32 GpSystemServices_Win32::ms_instance;
#pragma pop_macro("CreateMutex")

View File

@@ -0,0 +1,31 @@
#pragma once
#include "HostSystemServices.h"
#include "GpCoreDefs.h"
#include "GpWindows.h"
#pragma push_macro("CreateMutex")
#ifdef CreateMutex
#undef CreateMutex
#endif
class GpSystemServices_Win32 final : public PortabilityLayer::HostSystemServices
{
public:
GpSystemServices_Win32();
int64_t GetTime() const override;
void GetLocalDateTime(unsigned int &year, unsigned int &month, unsigned int &day, unsigned int &hour, unsigned int &minute, unsigned int &second) const override;
PortabilityLayer::HostMutex *CreateMutex() override;
PortabilityLayer::HostThreadEvent *CreateThreadEvent(bool autoReset, bool startSignaled) override;
uint64_t GetFreeMemoryCosmetic() const override;
void Beep() const override;
static GpSystemServices_Win32 *GetInstance();
private:
static GpSystemServices_Win32 ms_instance;
};
#pragma pop_macro("CreateMutex")

View File

@@ -0,0 +1,51 @@
#include "GpThreadEvent_Win32.h"
#include <stdlib.h>
#include <new>
void GpThreadEvent_Win32::Wait()
{
WaitForSingleObject(m_event, INFINITE);
}
void GpThreadEvent_Win32::WaitTimed(uint32_t msec)
{
WaitForSingleObject(m_event, static_cast<DWORD>(msec));
}
void GpThreadEvent_Win32::Signal()
{
SetEvent(m_event);
}
void GpThreadEvent_Win32::Destroy()
{
this->~GpThreadEvent_Win32();
free(this);
}
GpThreadEvent_Win32 *GpThreadEvent_Win32::Create(bool autoReset, bool startSignaled)
{
HANDLE handle = CreateEventA(nullptr, autoReset ? FALSE : TRUE, startSignaled ? TRUE : FALSE, nullptr);
if (handle == nullptr)
return nullptr;
void *storage = malloc(sizeof(GpThreadEvent_Win32));
if (!storage)
{
CloseHandle(handle);
return nullptr;
}
return new (storage) GpThreadEvent_Win32(handle);
}
GpThreadEvent_Win32::GpThreadEvent_Win32(const HANDLE &handle)
: m_event(handle)
{
}
GpThreadEvent_Win32::~GpThreadEvent_Win32()
{
CloseHandle(m_event);
}

View File

@@ -0,0 +1,22 @@
#pragma once
#include "HostThreadEvent.h"
#include "GpWindows.h"
class GpThreadEvent_Win32 final : public PortabilityLayer::HostThreadEvent
{
public:
void Wait() override;
void WaitTimed(uint32_t msec) override;
void Signal() override;
void Destroy() override;
static GpThreadEvent_Win32 *Create(bool autoReset, bool startSignaled);
private:
explicit GpThreadEvent_Win32(const HANDLE &handle);
~GpThreadEvent_Win32();
HANDLE m_event;
};

View File

@@ -0,0 +1,45 @@
#include "GpVOSEventQueue.h"
#include <assert.h>
GpVOSEventQueue::GpVOSEventQueue()
: m_firstEvent(0)
, m_numEventsQueued(0)
{
}
GpVOSEventQueue::~GpVOSEventQueue()
{
}
const GpVOSEvent *GpVOSEventQueue::GetNext()
{
if (m_numEventsQueued)
return m_events + m_firstEvent;
return nullptr;
}
void GpVOSEventQueue::DischargeOne()
{
assert(m_numEventsQueued > 0);
m_numEventsQueued--;
m_firstEvent++;
if (m_firstEvent == kMaxEvents)
m_firstEvent = 0;
}
GpVOSEvent *GpVOSEventQueue::QueueEvent()
{
if (m_numEventsQueued == kMaxEvents)
return nullptr;
size_t nextEvent = m_firstEvent + m_numEventsQueued;
if (nextEvent >= kMaxEvents)
nextEvent -= kMaxEvents;
m_numEventsQueued++;
return m_events + nextEvent;
}

View File

@@ -0,0 +1,25 @@
#pragma once
#include <stdint.h>
#include "HostVOSEventQueue.h"
#include "GpVOSEvent.h"
class GpVOSEventQueue final : public PortabilityLayer::HostVOSEventQueue
{
public:
GpVOSEventQueue();
~GpVOSEventQueue();
const GpVOSEvent *GetNext() override;
void DischargeOne() override;
GpVOSEvent *QueueEvent() override;
private:
static const size_t kMaxEvents = 10000;
GpVOSEvent m_events[kMaxEvents];
size_t m_firstEvent;
size_t m_numEventsQueued;
};

17
Aerofoil/resource.h Normal file
View File

@@ -0,0 +1,17 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by GpD3D.rc
//
#define IDI_ICON1 101
#define IDI_ICON2 102
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -0,0 +1,101 @@
{
"items" :
[
{
"name" : "Okay",
"itemType" : "Button",
"pos" : [ 267, 211 ],
"size" : [ 58, 20 ],
"id" : 0,
"enabled" : true
},
{
"name" : "Cancel",
"itemType" : "Button",
"pos" : [ 201, 211 ],
"size" : [ 58, 20 ],
"id" : 0,
"enabled" : true
},
{
"name" : "",
"itemType" : "Icon",
"pos" : [ 209, 40 ],
"size" : [ 32, 32 ],
"id" : 1020,
"enabled" : true
},
{
"name" : "",
"itemType" : "Icon",
"pos" : [ 249, 40 ],
"size" : [ 32, 32 ],
"id" : 1021,
"enabled" : true
},
{
"name" : "",
"itemType" : "Icon",
"pos" : [ 289, 40 ],
"size" : [ 32, 32 ],
"id" : 1022,
"enabled" : true
},
{
"name" : "Number of Rooms to Display:\r(the less rooms, the faster)",
"itemType" : "Label",
"pos" : [ 8, 40 ],
"size" : [ 195, 32 ],
"id" : 0,
"enabled" : false
},
{
"name" : "",
"itemType" : "Image",
"pos" : [ 0, 0 ],
"size" : [ 333, 32 ],
"id" : 1006,
"enabled" : false
},
{
"name" : "",
"itemType" : "UserItem",
"pos" : [ 8, 80 ],
"size" : [ 317, 1 ],
"id" : 0,
"enabled" : false
},
{
"name" : "Beautiful opening color fade",
"itemType" : "CheckBox",
"pos" : [ 8, 142 ],
"size" : [ 256, 18 ],
"id" : 0,
"enabled" : true
},
{
"name" : "",
"itemType" : "UserItem",
"pos" : [ 8, 137 ],
"size" : [ 317, 1 ],
"id" : 0,
"enabled" : false
},
{
"name" : "",
"itemType" : "UserItem",
"pos" : [ 8, 200 ],
"size" : [ 317, 1 ],
"id" : 0,
"enabled" : false
},
{
"name" : "Defaults",
"itemType" : "Button",
"pos" : [ 8, 211 ],
"size" : [ 64, 20 ],
"id" : 0,
"enabled" : true
}
]
}

View File

@@ -0,0 +1,9 @@
{
"add" :
{
"DITL/1017.json" : "ApplicationResourcePatches/DITL/1017.json"
},
"delete" :
[
]
}

BIN
CarbonLib

Binary file not shown.

13
Common.props Normal file
View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

46
Common/CoreDefs.h Normal file
View File

@@ -0,0 +1,46 @@
#pragma once
#if __cplusplus >= 199711L
#define GP_IS_CPP11 1
#else
#define GP_IS_CPP11 0
#endif
#if GP_IS_CPP11
#define GP_DELETED = delete
#define GP_STATIC_ASSERT(n) static_assert((n), "Static assert failed: " #n)
#else
#ifndef nullptr
#define nullptr 0
#endif
#ifndef override
#define override
#endif
#ifndef final
#define final
#endif
#define GP_DELETED
template<bool TCondition>
struct __GpStaticAssertHelper
{
};
template<>
struct __GpStaticAssertHelper<true>
{
int staticAssertFailed;
};
#define GP_STATIC_ASSERT(n) ((void)(&static_cast<const __GpStaticAssertHelper<(n)>*>(nullptr)->staticAssertFailed))
#endif
static const size_t GP_SYSTEM_MEMORY_ALIGNMENT = 16;
#if !defined(NDEBUG)
#define GP_DEBUG_CONFIG 1
#endif

View File

@@ -0,0 +1,114 @@
#include <stdio.h>
#include <stdint.h>
#include <d3dcompiler.h>
#pragma comment(lib, "D3DCompiler.lib")
struct CompileJob
{
LPCWSTR m_filename;
LPCWSTR m_outputFilename;
LPCSTR m_shaderVarName;
const D3D_SHADER_MACRO *m_defs;
LPCSTR m_entryPoint;
LPCSTR m_target;
};
const D3D_SHADER_MACRO drawQuadDefs[] =
{
{ nullptr }
};
const CompileJob kCompileJobs[] =
{
{
L"ShaderSrc\\DrawQuadV.hlsl",
L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuadV_D3D11.cpp",
"g_drawQuadV_D3D11",
drawQuadDefs,
"VSMain",
"vs_4_0"
},
{
L"ShaderSrc\\DrawQuadRGBP.hlsl",
L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuadRGBP_D3D11.cpp",
"g_drawQuadRGBP_D3D11",
drawQuadDefs,
"PSMain",
"ps_4_0"
},
{
L"ShaderSrc\\DrawQuadPaletteP.hlsl",
L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuadPaletteP_D3D11.cpp",
"g_drawQuadPaletteP_D3D11",
drawQuadDefs,
"PSMain",
"ps_4_0"
},
{
L"ShaderSrc\\DrawQuad15BitP.hlsl",
L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuad15BitP_D3D11.cpp",
"g_drawQuad15BitP_D3D11",
drawQuadDefs,
"PSMain",
"ps_4_0"
}
};
int main(int argc, const char **argv)
{
const size_t numJobs = sizeof(kCompileJobs) / sizeof(kCompileJobs[0]);
UINT flags = D3DCOMPILE_ENABLE_STRICTNESS | D3DCOMPILE_OPTIMIZATION_LEVEL3;
for (size_t i = 0; i < numJobs; i++)
{
const CompileJob &job = kCompileJobs[i];
ID3DBlob *code = nullptr;
ID3DBlob *errorMsgs = nullptr;
HRESULT result = D3DCompileFromFile(job.m_filename, job.m_defs, D3D_COMPILE_STANDARD_FILE_INCLUDE, job.m_entryPoint, job.m_target, flags, 0, &code, &errorMsgs);
if (result != S_OK)
{
fprintf(stderr, "Compile failure error: %x", static_cast<int>(result));
}
if (errorMsgs)
{
fputs(static_cast<const char*>(errorMsgs->GetBufferPointer()), stderr);
errorMsgs->Release();
}
if (code)
{
FILE *f = nullptr;
errno_t errorCode = _wfopen_s(&f, job.m_outputFilename, L"wb");
if (!errorCode)
{
fprintf(f, "static unsigned char gs_shaderData[] = {");
const uint8_t *bytes = static_cast<const uint8_t *>(code->GetBufferPointer());
const size_t size = code->GetBufferSize();
for (size_t i = 0; i < size; i++)
{
if (i % 15 == 0)
fputs("\n\t", f);
fprintf(f, "%3i, ", static_cast<int>(bytes[i]));
}
fprintf(f, "\n};\n\n");
fprintf(f, "namespace GpBinarizedShaders\n{\n");
fprintf(f, "\tconst unsigned char *%s[2] = { gs_shaderData, gs_shaderData + sizeof(gs_shaderData) }; \n", job.m_shaderVarName);
fprintf(f, "};\n");
fclose(f);
}
code->Release();
}
}
return 0;
}

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{ED2F91E1-673A-4590-82B2-EB157927D3E3}</ProjectGuid>
<RootNamespace>CompileShadersD3D11</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="CompileShadersD3D11.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="CompileShadersD3D11.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,455 @@
#include "CFileStream.h"
#include "BMPFormat.h"
#include "MMHandleBlock.h"
#include "ResourceCompiledTypeList.h"
#include "ResourceFile.h"
#include "SharedTypes.h"
#include "QDStandardPalette.h"
#include "PLBigEndian.h"
#include <assert.h>
#include <string>
#include <vector>
#include "stb_image_write.h"
// This extracts all of the color cursors from a resource file and converts them to
// Windows cursor format.
//
// Windows only supports loading color cursors by loading them from an executable or DLL resource,
// or by loading them from a file, so we can't just do the conversion/construction at runtime.
//
// Also, classic Mac cursor features are not fully supported by newer operating systems.
// The classic Mac cursor function is basically (existing ^ color) where the mask bit isn't set,
// so it supports inversion masking and colors with the same cursor.
//
// Fortunately, none of the Glider PRO cursors use this combination.
//
// The color cursor format is not fully documented. Appears to be:
// Header
// CursorPixMapPrefix (at pixMapOffset)
// BEPixMap
// Pixel data
// BEColorTableHeader
// BEColorTableItem[...]
struct CursorPixMapPrefix
{
BEUInt32_t m_unknown; // Seems to always be zero
BEUInt16_t m_subFormat; // 0x8002 = 2 colors, 0x8004 = 4 colors, 0x8008 = 16 colors, 0x8010 = 256 colors
};
struct CursorHeader
{
BEUInt16_t m_cursorType;
BEUInt32_t m_pixMapOffset;
BEUInt32_t m_pixDataOffset;
BEUInt32_t m_expandedData;
BEUInt16_t m_expandedDataDepth;
BEUInt32_t m_unused;
uint8_t m_bwCursor[32];
uint8_t m_mask[32];
BEUInt16_t m_hotSpotY;
BEUInt16_t m_hotSpotX;
BEUInt32_t m_colorTableResourceID;
BEUInt32_t m_cursorResourceID;
};
struct BWCursor
{
uint8_t m_pixels[32];
uint8_t m_mask[32];
BEUInt16_t m_hotSpotX;
BEUInt16_t m_hotSpotY;
};
struct IconDir
{
uint16_t m_reserved;
uint16_t m_type;
uint16_t m_numImages;
};
struct IconDirEntry
{
uint8_t m_width;
uint8_t m_height;
uint8_t m_numColors;
uint8_t m_reserved;
uint16_t m_numPlanes_HotSpotX;
uint16_t m_bpp_HotSpotY;
uint32_t m_imageDataSize;
uint32_t m_imageDataOffset;
};
uint8_t CompactChannel(const uint8_t *doublet)
{
unsigned int doubletValue = (doublet[0] << 8) + doublet[1];
return (doubletValue * 2 + 0x101) / 0x202;
}
void WriteToFileCallback(void *context, void *data, int size)
{
fwrite(data, 1, size, static_cast<FILE*>(context));
}
void WriteToVectorCallback(void *context, void *data, int size)
{
std::vector<uint8_t> *vec = static_cast<std::vector<uint8_t>*>(context);
for (int i = 0; i < size; i++)
vec->push_back(static_cast<const uint8_t*>(data)[i]);
}
void ConvertBWCursors(PortabilityLayer::ResourceFile *resFile)
{
const PortabilityLayer::ResourceCompiledTypeList *typeList = resFile->GetResourceTypeList('CURS');
if (!typeList)
return;
const size_t numRefs = typeList->m_numRefs;
for (size_t i = 0; i < numRefs; i++)
{
const int resID = typeList->m_firstRef[i].m_resID;
const THandle<void> resHdl = resFile->LoadResource('CURS', resID);
const void *cursorDataBase = *resHdl;
const BWCursor *cursorData = static_cast<const BWCursor *>(cursorDataBase);
char outPathDebug[64];
sprintf_s(outPathDebug, "Packaged\\WinCursors\\b%i.bmp", resID);
char outPath[64];
sprintf_s(outPath, "Packaged\\WinCursors\\b%i.cur", resID);
FILE *outF = nullptr;
errno_t outErr = fopen_s(&outF, outPath, "wb");
if (!outErr)
{
IconDir iconDir;
iconDir.m_reserved = 0;
iconDir.m_type = 2;
iconDir.m_numImages = 1;
IconDirEntry iconDirEntry;
iconDirEntry.m_width = 16;
iconDirEntry.m_height = 16;
iconDirEntry.m_numColors = 0;
iconDirEntry.m_reserved = 0;
iconDirEntry.m_numPlanes_HotSpotX = cursorData->m_hotSpotX;
iconDirEntry.m_bpp_HotSpotY = cursorData->m_hotSpotY;
iconDirEntry.m_imageDataSize = 0;
iconDirEntry.m_imageDataOffset = sizeof(IconDir) + sizeof(IconDirEntry);
fwrite(&iconDir, 1, sizeof(IconDir), outF);
fwrite(&iconDirEntry, 1, sizeof(IconDirEntry), outF);
long imageDataStart = ftell(outF);
PortabilityLayer::BitmapInfoHeader bmpHeader;
bmpHeader.m_thisStructureSize = sizeof(bmpHeader);
bmpHeader.m_width = 16;
bmpHeader.m_height = 32;
bmpHeader.m_planes = 1;
bmpHeader.m_bitsPerPixel = 1;
bmpHeader.m_compression = 0;
bmpHeader.m_imageSize = (16 * 16 / 8);
bmpHeader.m_xPixelsPerMeter = 0;
bmpHeader.m_yPixelsPerMeter = 0;
bmpHeader.m_numColors = 2;
bmpHeader.m_importantColorCount = 2;
fwrite(&bmpHeader, 1, sizeof(bmpHeader), outF);
const uint8_t paletteData[] = {
0, 0, 0, 0,
255, 255, 255, 0 };
fwrite(paletteData, 1, sizeof(paletteData), outF);
uint8_t padding[2] = { 0, 0 };
for (int y = 0; y < 16; y++)
{
const uint8_t *maskRow = cursorData->m_mask + (15 - y) * 2;
const uint8_t *row = cursorData->m_pixels + (15 - y) * 2;
const uint8_t modifiedRow[] = { row[0] ^ maskRow[0], row[1] ^ maskRow[1] };
fwrite(modifiedRow, 1, 2, outF);
fwrite(padding, 1, 2, outF);
}
for (int y = 0; y < 16; y++)
{
const uint8_t *row = cursorData->m_mask + (15 - y) * 2;
const uint8_t modifiedRow[] = { row[0] ^ 255, row[1] ^ 255 };
fwrite(modifiedRow, 1, 2, outF);
fwrite(padding, 1, 2, outF);
}
long imageDataEnd = ftell(outF);
fseek(outF, sizeof(IconDir), SEEK_SET);
iconDirEntry.m_imageDataSize = static_cast<uint32_t>(imageDataEnd - imageDataStart);
fwrite(&iconDirEntry, 1, sizeof(IconDirEntry), outF);
fclose(outF);
}
}
}
void ConvertCursors(PortabilityLayer::ResourceFile *resFile)
{
const PortabilityLayer::ResourceCompiledTypeList *typeList = resFile->GetResourceTypeList('crsr');
if (!typeList)
return;
const size_t numRefs = typeList->m_numRefs;
for (size_t i = 0; i < numRefs; i++)
{
const int resID = typeList->m_firstRef[i].m_resID;
const THandle<void> resHdl = resFile->LoadResource('crsr', resID);
const void *cursorDataBase = *resHdl;
const void *cursorData = cursorDataBase;
const CursorHeader *cursorHeader = static_cast<const CursorHeader *>(cursorData);
cursorData = cursorHeader + 1;
cursorData = static_cast<const void*>(reinterpret_cast<const uint8_t*>(cursorDataBase) + cursorHeader->m_pixMapOffset);
const CursorPixMapPrefix *cursorPixMapPrefix = static_cast<const CursorPixMapPrefix *>(cursorData);
cursorData = cursorPixMapPrefix + 1;
const BEPixMap *pixMap = reinterpret_cast<const BEPixMap*>(reinterpret_cast<const uint8_t*>(cursorData));
cursorData = pixMap + 1;
cursorData = static_cast<const void*>(reinterpret_cast<const uint8_t*>(cursorDataBase) + cursorHeader->m_pixDataOffset);
const uint8_t *pixMapDataBytes = static_cast<const uint8_t*>(cursorData);
const Rect rect = pixMap->m_bounds.ToRect();
const int width = rect.right - rect.left;
const int height = rect.bottom - rect.top;
const int componentSize = static_cast<int>(pixMap->m_componentSize);
switch (componentSize)
{
case 1:
case 2:
case 4:
case 8:
break;
default:
assert(false);
break;
}
const int bitsRequired = width * height * componentSize;
const int bytesRequired = (bitsRequired + 7) / 8;
uint8_t *colorValues = new uint8_t[width * height];
const int numPixels = width * height;
switch (componentSize)
{
case 1:
for (int i = 0; i < numPixels; i++)
colorValues[i] = (pixMapDataBytes[i / 8] >> (7 - (i & 7) * 1)) & 0x1;
break;
case 2:
for (int i = 0; i < numPixels; i++)
colorValues[i] = (pixMapDataBytes[i / 4] >> (6 - (i & 3) * 2)) & 0x3;
break;
case 4:
for (int i = 0; i < numPixels; i++)
colorValues[i] = (pixMapDataBytes[i / 2] >> (4 - (i & 1) * 4)) & 0xf;
break;
case 8:
for (int i = 0; i < numPixels; i++)
colorValues[i] = pixMapDataBytes[i];
break;
default:
assert(false);
break;
}
cursorData = static_cast<const void*>(pixMapDataBytes + bytesRequired);
const BEColorTableHeader *colorTableHeader = static_cast<const BEColorTableHeader *>(cursorData);
cursorData = colorTableHeader + 1;
const BEColorTableItem *ctabItems = static_cast<const BEColorTableItem *>(cursorData);
uint32_t decodedCTabItems[256];
const int numCTabItems = colorTableHeader->m_numItemsMinusOne + 1;
for (int i = 0; i < numCTabItems; i++)
{
const BEColorTableItem &item = ctabItems[i];
unsigned char rgba[4];
rgba[0] = CompactChannel(item.m_red);
rgba[1] = CompactChannel(item.m_green);
rgba[2] = CompactChannel(item.m_blue);
rgba[3] = 255;
int index = item.m_index;
assert(index >= 0 && index < 256);
memcpy(decodedCTabItems + index, rgba, 4);
}
uint32_t *pixelDataRGBA = new uint32_t[width * height * 4];
for (int i = 0; i < numPixels; i++)
{
const uint8_t ctabIndex = colorValues[i];
pixelDataRGBA[i] = decodedCTabItems[ctabIndex];
if (((cursorHeader->m_mask[i / 8] >> (7 - (i & 7))) & 1) == 0)
reinterpret_cast<uint8_t*>(pixelDataRGBA + i)[3] = 0;
}
char outPath[64];
sprintf_s(outPath, "Packaged\\WinCursors\\c%i.cur", resID);
FILE *outF = nullptr;
errno_t outErr = fopen_s(&outF, outPath, "wb");
if (!outErr)
{
IconDir iconDir;
iconDir.m_reserved = 0;
iconDir.m_type = 2;
iconDir.m_numImages = 1;
IconDirEntry iconDirEntry;
iconDirEntry.m_width = width;
iconDirEntry.m_height = height;
iconDirEntry.m_numColors = 0;
iconDirEntry.m_reserved = 0;
iconDirEntry.m_numPlanes_HotSpotX = cursorHeader->m_hotSpotX;
iconDirEntry.m_bpp_HotSpotY = cursorHeader->m_hotSpotY;
iconDirEntry.m_imageDataSize = 0;
iconDirEntry.m_imageDataOffset = sizeof(IconDir) + sizeof(IconDirEntry);
fwrite(&iconDir, 1, sizeof(IconDir), outF);
fwrite(&iconDirEntry, 1, sizeof(IconDirEntry), outF);
long imageDataStart = ftell(outF);
stbi_write_png_to_func(WriteToFileCallback, outF, width, height, 4, pixelDataRGBA, width * 4);
long imageDataEnd = ftell(outF);
fseek(outF, sizeof(IconDir), SEEK_SET);
iconDirEntry.m_imageDataSize = static_cast<uint32_t>(imageDataEnd - imageDataStart);
fwrite(&iconDirEntry, 1, sizeof(IconDirEntry), outF);
fclose(outF);
}
delete[] colorValues;
delete[] pixelDataRGBA;
resHdl.Dispose();
}
}
void ConvertIconFamily(PortabilityLayer::ResourceFile *resFile, int32_t iconBitmapType, int32_t iconColorType, const char *prefix, unsigned int dimension)
{
const PortabilityLayer::ResourceCompiledTypeList *typeList = resFile->GetResourceTypeList(iconBitmapType);
if (!typeList)
return;
const size_t numRefs = typeList->m_numRefs;
for (size_t i = 0; i < numRefs; i++)
{
const int resID = typeList->m_firstRef[i].m_resID;
const THandle<void> bwBlock = resFile->LoadResource(iconBitmapType, resID);
const THandle<void> colorBlock = resFile->LoadResource(iconColorType, resID);
if (!bwBlock || !colorBlock)
{
bwBlock.Dispose();
colorBlock.Dispose();
continue;
}
const uint8_t *bwIconData = static_cast<const uint8_t*>(*bwBlock);
const uint8_t *bwMaskData = bwIconData + (dimension * dimension / 8);
const uint8_t *indexedData = static_cast<const uint8_t*>(*colorBlock);
PortabilityLayer::RGBAColor *pixelData = new PortabilityLayer::RGBAColor[dimension * dimension * 4];
for (unsigned int i = 0; i < dimension * dimension; i++)
{
PortabilityLayer::RGBAColor &item = pixelData[i];
item = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[indexedData[i]];
if (bwMaskData[i / 8] & (0x80 >> (i & 7)))
item.a = 255;
else
item.a = 0;
}
char outPath[256];
sprintf_s(outPath, "Aerofoil\\ConvertedResources\\%s%i.ico", prefix, resID);
FILE *outF = nullptr;
errno_t outErr = fopen_s(&outF, outPath, "wb");
if (!outErr)
{
IconDir iconDir;
iconDir.m_reserved = 0;
iconDir.m_type = 1;
iconDir.m_numImages = 1;
IconDirEntry iconDirEntry;
iconDirEntry.m_width = dimension;
iconDirEntry.m_height = dimension;
iconDirEntry.m_numColors = 0;
iconDirEntry.m_reserved = 0;
iconDirEntry.m_numPlanes_HotSpotX = 0;
iconDirEntry.m_bpp_HotSpotY = 32;
iconDirEntry.m_imageDataSize = 0;
iconDirEntry.m_imageDataOffset = sizeof(IconDir) + sizeof(IconDirEntry);
fwrite(&iconDir, 1, sizeof(IconDir), outF);
fwrite(&iconDirEntry, 1, sizeof(IconDirEntry), outF);
long imageDataStart = ftell(outF);
stbi_write_png_to_func(WriteToFileCallback, outF, dimension, dimension, 4, pixelData, dimension * 4);
long imageDataEnd = ftell(outF);
fseek(outF, sizeof(IconDir), SEEK_SET);
iconDirEntry.m_imageDataSize = static_cast<uint32_t>(imageDataEnd - imageDataStart);
fwrite(&iconDirEntry, 1, sizeof(IconDirEntry), outF);
fclose(outF);
}
delete[] pixelData;
bwBlock.Dispose();
colorBlock.Dispose();
}
}
int main(int argc, const char **argv)
{
FILE *f = nullptr;
errno_t err = fopen_s(&f, "Packaged\\ApplicationResources.gpr", "rb");
if (err)
return err;
PortabilityLayer::CFileStream stream(f);
PortabilityLayer::ResourceFile *resFile = PortabilityLayer::ResourceFile::Create();
if (!resFile->Load(&stream))
return -1;
stream.Close();
ConvertCursors(resFile);
ConvertBWCursors(resFile);
ConvertIconFamily(resFile, 'ics#', 'ics8', "Small", 16);
ConvertIconFamily(resFile, 'ICN#', 'icl8', "Large", 32);
return 0;
}

View File

@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{B852D549-4020-4477-8BFB-E199FF78B047}</ProjectGuid>
<RootNamespace>ConvertColorCursors</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\GpCommon.props" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\Common.props" />
<Import Project="..\stb.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\GpCommon.props" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\Common.props" />
<Import Project="..\stb.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\GpCommon.props" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\Common.props" />
<Import Project="..\stb.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\GpCommon.props" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\Common.props" />
<Import Project="..\stb.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\PortabilityLayer\PortabilityLayer.vcxproj">
<Project>{6ec62b0f-9353-40a4-a510-3788f1368b33}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\stb\stb_image_write.c" />
<ClCompile Include="ConvertColorCursors.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ConvertColorCursors.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\stb\stb_image_write.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

82
ConvertResources.bat Normal file
View File

@@ -0,0 +1,82 @@
mkdir Packaged
mkdir Packaged\Houses
mkdir Packaged\WinCursors
x64\Release\MiniRez.exe "GliderProData\Glider PRO.r" Packaged\ApplicationResources.gpr
x64\Release\gpr2gpa.exe "Packaged\ApplicationResources.gpr" "DefaultTimestamp.timestamp" "Packaged\ApplicationResources.gpa" "ApplicationResourcePatches\manifest.json"
x64\Release\ConvertColorCursors.exe
attrib -R Packaged\Houses\*
x64\Release\hqx2gp.exe "GliderProData\Houses\Art Museum.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Art Museum"
x64\Release\hqx2gp.exe "GliderProData\Houses\California or Bust!.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\California or Bust!"
x64\Release\hqx2gp.exe "GliderProData\Houses\Castle o' the Air.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Castle o' the Air"
x64\Release\hqx2gp.exe "GliderProData\Houses\CD Demo House.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\CD Demo House"
x64\Release\hqx2gp.exe "GliderProData\Houses\Davis Station.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Davis Station"
x64\Release\hqx2gp.exe "GliderProData\Houses\Demo House.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Demo House"
x64\Release\hqx2gp.exe "GliderProData\Houses\Empty House.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Empty House"
x64\Release\hqx2gp.exe "GliderProData\Houses\Fun House.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Fun House"
x64\Release\hqx2gp.exe "GliderProData\Houses\Grand Prix.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Grand Prix"
x64\Release\hqx2gp.exe "GliderProData\Houses\ImagineHouse PRO II.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\ImagineHouse PRO II"
x64\Release\hqx2gp.exe "GliderProData\Houses\In The Mirror.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\In The Mirror"
x64\Release\hqx2gp.exe "GliderProData\Houses\Land of Illusion.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Land of Illusion"
x64\Release\hqx2gp.exe "GliderProData\Houses\Leviathan.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Leviathan"
x64\Release\hqx2gp.exe "GliderProData\Houses\Metropolis.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Metropolis"
x64\Release\hqx2gp.exe "GliderProData\Houses\Nemo's Market.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Nemo's Market"
x64\Release\hqx2gp.exe "GliderProData\Houses\Rainbow's End.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Rainbow's End"
x64\Release\hqx2gp.exe "GliderProData\Houses\Sampler.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Sampler"
x64\Release\hqx2gp.exe "GliderProData\Houses\Slumberland.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Slumberland"
x64\Release\hqx2gp.exe "GliderProData\Houses\SpacePods.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\SpacePods"
x64\Release\hqx2gp.exe "GliderProData\Houses\Teddy World.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Teddy World"
x64\Release\hqx2gp.exe "GliderProData\Houses\The Asylum Pro.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\The Asylum Pro"
x64\Release\hqx2gp.exe "GliderProData\Houses\Titanic.binhex" "DefaultTimestamp.timestamp" "Packaged\Houses\Titanic"
x64\Release\gpr2gpa.exe "Packaged\Houses\Art Museum.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Art Museum.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\California or Bust!.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\California or Bust!.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Castle o' the Air.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Castle o' the Air.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\CD Demo House.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\CD Demo House.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Davis Station.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Davis Station.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Demo House.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Demo House.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Empty House.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Empty House.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Fun House.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Fun House.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Grand Prix.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Grand Prix.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\ImagineHouse PRO II.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\ImagineHouse PRO II.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\In The Mirror.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\In The Mirror.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Land of Illusion.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Land of Illusion.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Leviathan.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Leviathan.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Metropolis.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Metropolis.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Nemo's Market.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Nemo's Market.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Rainbow's End.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Rainbow's End.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Sampler.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Sampler.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Slumberland.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Slumberland.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\SpacePods.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\SpacePods.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Teddy World.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Teddy World.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\The Asylum Pro.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\The Asylum Pro.gpa"
x64\Release\gpr2gpa.exe "Packaged\Houses\Titanic.gpr" "DefaultTimestamp.timestamp" "Packaged\Houses\Titanic.gpa"
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Art Museum.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Castle o' the Air.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\CD Demo House.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Davis Station.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Demo House.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Grand Prix.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\ImagineHouse PRO II.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Land of Illusion.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Leviathan.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Nemo's Market.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Rainbow's End.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Slumberland.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\SpacePods.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Teddy World.mov.gpf" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "DefaultTimestamp.timestamp" "Packaged\Houses\Titanic.mov.gpf" MooV ozm5 0 0 locked
del /Q Packaged\Houses\*.gpr
del /Q Packaged\ApplicationResources.gpr
copy /Y GliderProData\ConvertedMovies\*.mov.gpa Packaged\Houses\
attrib +R Packaged\Houses\*
pause

BIN
DefaultTimestamp.timestamp Normal file

Binary file not shown.

View File

@@ -0,0 +1,24 @@
As with Glider PRO's Room Editor, custom backgrounds, sounds, and TV videos
are supported.
Since Glider PRO used formats that were very Mac-specific, Aerofoil has
replaced most of them with more current formats.
To add resources to a house, create a ZIP file with the extension ".gpa" with
the same name as the .gpd and .gpf files that already exist for the house.
You can add resources by adding them to a folder named as the resource type,
with the appropriate extension.
For example, for a "PICT" resource of ID "3000", create a file named "3000.bmp"
and put it in the "PICT" directory in the .gpa archive.
PICT resources, used for custom decorations and backgrounds, must be BMP files.
Sounds should go in a directory named "snd$20"
Sounds must be WAV format, monaural, 8-bit unsigned PCM, 22255 Hz.
Sounds recorded at a different sample rate will play back at the wrong speed.
Sounds that are not monaural or 8-bit unsigned PCM will fail to load.
Resource IDs must be between -32768 and 32767. Other resource IDs will fail
to load.

View File

@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -0,0 +1,57 @@
Tencent is pleased to support the open source community by making RapidJSON available.
Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
If you have downloaded a copy of the RapidJSON binary from Tencent, please note that the RapidJSON binary is licensed under the MIT License.
If you have downloaded a copy of the RapidJSON source code from Tencent, please note that RapidJSON source code is licensed under the MIT License, except for the third-party components listed below which are subject to different license terms. Your integration of RapidJSON into your own projects may require compliance with the MIT License, as well as the other licenses applicable to the third-party components included within RapidJSON. To avoid the problematic JSON license in your own projects, it's sufficient to exclude the bin/jsonchecker/ directory, as it's the only code under the JSON license.
A copy of the MIT License is included in this file.
Other dependencies and licenses:
Open Source Software Licensed Under the BSD License:
--------------------------------------------------------------------
The msinttypes r29
Copyright (c) 2006-2013 Alexander Chemeris
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Open Source Software Licensed Under the JSON License:
--------------------------------------------------------------------
json.org
Copyright (c) 2002 JSON.org
All Rights Reserved.
JSON_checker
Copyright (c) 2002 JSON.org
All Rights Reserved.
Terms of the JSON License:
---------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Terms of the MIT License:
--------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

82
Documentation/readme.txt Normal file
View File

@@ -0,0 +1,82 @@
Aerofoil is a third-party port of Glider PRO
Aerofoil is (c)2019-2020 Eric Lasota
Glider PRO is (c)1994-2000 Casady & Greene, Inc., written by John Calhoun
Aerofoil is not maintained by, supported by, endorsed by, or otherwise associated with the authors and publishers of Glider PRO.
Please do not contact any of them regarding issues related to Aerofoil.
If you have an issue with Aerofoil, please post an issue to the Aerofoil issue tracker on GitHub:
https://github.com/elasota/Aerofoil/issues
Requires Windows 8 and the Visual Studio 2017 redistributable runtime.
Please see this page for more info:
https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads
XInput gamepads are supported. Other gamepads may be supported via third-party software that maps them to XInput (i.e. PS4 gamepads are supported via DS4Windows)
Some shortcuts:
- While in-game, Ctrl-S saves the game. You can then reload the game from the main menu.
- Ctrl-Q quits the game.
Aerofoil uses the following third-party software:
-------------------------------------------------------------------------------
Open Sans font:
(c)2011 Google
Distributed under the Apache License (see license_apache.txt)
-------------------------------------------------------------------------------
stb_image_write:
Created by Sean Barrett
-------------------------------------------------------------------------------
LIBICONV:
Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
Distributed under the LGPLv2 license (See license_lgplv2.txt)
-------------------------------------------------------------------------------
RapidJSON:
Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
Distributed under the MIT license (See license_rapidjson.txt)
-------------------------------------------------------------------------------
zlib:
(C) 1995-2017 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
-------------------------------------------------------------------------------
FreeType:
Portions of this software are copyright (c)2020 The FreeType Project (www.freetype.org). All rights reserved.
Distributed under the GPLv2 license (see license_gplv2.txt)

View File

@@ -0,0 +1,16 @@
If you want to import an existing third-party Glider PRO house to Aerofoil, a few steps are required.
First, you need to generate a timestamp file. Use the "MakeTimestamp" utility to dump the current time to a timestamp file.
Second, you need to extract the house data from the original archive. Most existing Glider PRO houses are in StuffIt! archives (.sit extension), which can be difficult to extract. There is a utility called The Unarchiver for macOS which appears to support it. An alternative is to extract the file on an actual vintage Mac.
The next step depends on whether or not the house has custom resources. If the house doesn't have custom resources, then add a ".gpd" extension to the house and use the FTagData utility to generate a corresponding ".gpf" metadata file, using the timestamp you generated in the first step. You need to specify "gliH" as the file type ID and "ozm5" as the file creator ID.
If the house does have custom resources, then you need to get the resource data somehow, and you still need to generate the metadata. There are a few options there:
- If extracting the file generated a separate file containing the resource data, which I think is what happens when extracting files on macOS, then you can use the resource file directly, and handle the other steps the same as you would if it didn't have custom resources.
- If you can get the house into MacBinary format, then you can use the "bin2gp" utility to convert it to .gpf, .gpd, and .gpr files.
- If you can get the house into BinHex4 (.hqx) format, then you can use the "hqx2gp" utility to convert it to .gpf, .gpd, and .gpr files.
Once you have a .gpr file of the raw Mac-format resource data, you need to convert it to Aerofoil's ZIP-based resource archive format and convert the internal resources out of Mac-specific formats. Use the "gpr2gpa" utility to do this.
gpr2gpa's PICT converter may not support all PICT encodings. If you find a house with custom PICT resources that isn't supported, please submit a sample to Aerofoil's issue tracker.

90
FTagData/FTagData.cpp Normal file
View File

@@ -0,0 +1,90 @@
#include <stdio.h>
#include <string>
#include <Windows.h>
#include "MacFileInfo.h"
int main(int argc, const char **argv)
{
if (argc < 7)
{
fprintf(stderr, "FTagData <timestamp> <output.gpf> <file type ID> <file creator ID> <x pos> <y pos> [flags]");
return -1;
}
std::string timestampPath = argv[1];
std::string outPath = argv[2];
if (strlen(argv[3]) != 4)
{
fprintf(stderr, "File type ID must be 4 characters");
return -2;
}
if (strlen(argv[4]) != 4)
{
fprintf(stderr, "File creator ID must be 4 characters");
return -3;
}
FILE *tsF = nullptr;
errno_t ferr = fopen_s(&tsF, timestampPath.c_str(), "rb");
int64_t timestamp = 0;
if (!ferr)
{
uint8_t encodedTimestamp[8];
if (fread(encodedTimestamp, 1, 8, tsF) != 8)
{
fprintf(stderr, "Error reading timestamp file");
return -1;
}
for (int i = 0; i < 8; i++)
timestamp |= static_cast<int64_t>(encodedTimestamp[i]) << (i * 8);
fclose(tsF);
}
PortabilityLayer::MacFileProperties mfp;
memcpy(mfp.m_fileType, argv[3], 4);
memcpy(mfp.m_fileCreator, argv[4], 4);
mfp.m_xPos = atoi(argv[5]);
mfp.m_yPos = atoi(argv[6]);
mfp.m_finderFlags = 0;
mfp.m_protected = 0;
mfp.m_modifiedDate = mfp.m_creationDate = timestamp;
for (int i = 7; i < argc; i++)
{
const char *arg = argv[i];
if (!strcmp(arg, "locked"))
mfp.m_finderFlags |= PortabilityLayer::FINDER_FILE_FLAG_LOCKED;
else if (!strcmp(arg, "invisible"))
mfp.m_finderFlags |= PortabilityLayer::FINDER_FILE_FLAG_INVISIBLE;
else if (!strcmp(arg, "bundle"))
mfp.m_finderFlags |= PortabilityLayer::FINDER_FILE_FLAG_BUNDLE;
else if (!strcmp(arg, "system"))
mfp.m_finderFlags |= PortabilityLayer::FINDER_FILE_FLAG_SYSTEM;
else if (!strcmp(arg, "copyprotected"))
mfp.m_finderFlags |= PortabilityLayer::FINDER_FILE_FLAG_COPY_PROTECTED;
else if (!strcmp(arg, "busy"))
mfp.m_finderFlags |= PortabilityLayer::FINDER_FILE_FLAG_BUSY;
else if (!strcmp(arg, "changed"))
mfp.m_finderFlags |= PortabilityLayer::FINDER_FILE_FLAG_CHANGED;
else if (!strcmp(arg, "inited"))
mfp.m_finderFlags |= PortabilityLayer::FINDER_FILE_FLAG_INITED;
}
PortabilityLayer::MacFilePropertiesSerialized mps;
mps.Serialize(mfp);
FILE *file = nullptr;
errno_t err = fopen_s(&file, outPath.c_str(), "wb");
if (!err)
{
fwrite(mps.m_data, PortabilityLayer::MacFilePropertiesSerialized::kSize, 1, file);
fclose(file);
}
return 0;
}

140
FTagData/FTagData.vcxproj Normal file
View File

@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}</ProjectGuid>
<RootNamespace>FTagData</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\GpCommon.props" />
<Import Project="..\Common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\GpCommon.props" />
<Import Project="..\Common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\GpCommon.props" />
<Import Project="..\Common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PortabilityLayer.props" />
<Import Project="..\GpCommon.props" />
<Import Project="..\Common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\PortabilityLayer\PortabilityLayer.vcxproj">
<Project>{6ec62b0f-9353-40a4-a510-3788f1368b33}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="FTagData.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="FTagData.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

157
FreeType/FreeType.vcxproj Normal file
View File

@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="freetype\src\winfonts\fnterrs.h" />
<ClInclude Include="freetype\src\winfonts\winfnt.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="freetype\src\autofit\autofit.c" />
<ClCompile Include="freetype\src\base\ftbase.c" />
<ClCompile Include="freetype\src\base\ftbitmap.c" />
<ClCompile Include="freetype\src\base\ftdebug.c" />
<ClCompile Include="freetype\src\base\ftinit.c" />
<ClCompile Include="freetype\src\base\ftsystem.c" />
<ClCompile Include="freetype\src\bdf\bdf.c" />
<ClCompile Include="freetype\src\cff\cff.c" />
<ClCompile Include="freetype\src\cid\type1cid.c" />
<ClCompile Include="freetype\src\gzip\ftgzip.c" />
<ClCompile Include="freetype\src\lzw\ftlzw.c" />
<ClCompile Include="freetype\src\pcf\pcf.c" />
<ClCompile Include="freetype\src\pfr\pfr.c" />
<ClCompile Include="freetype\src\psaux\psaux.c" />
<ClCompile Include="freetype\src\pshinter\pshinter.c" />
<ClCompile Include="freetype\src\psnames\psnames.c" />
<ClCompile Include="freetype\src\raster\raster.c" />
<ClCompile Include="freetype\src\sfnt\sfnt.c" />
<ClCompile Include="freetype\src\smooth\smooth.c" />
<ClCompile Include="freetype\src\truetype\truetype.c" />
<ClCompile Include="freetype\src\type1\type1.c" />
<ClCompile Include="freetype\src\type42\type42.c" />
<ClCompile Include="freetype\src\winfonts\winfnt.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}</ProjectGuid>
<RootNamespace>FreeType</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\FreeTypePublic.props" />
<Import Project="FreeTypePrivate.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\FreeTypePublic.props" />
<Import Project="FreeTypePrivate.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\FreeTypePublic.props" />
<Import Project="FreeTypePrivate.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\FreeTypePublic.props" />
<Import Project="FreeTypePrivate.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Source Files\winfnt">
<UniqueIdentifier>{5cbb99df-384f-4cdd-b388-325e52ed4c9e}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\base">
<UniqueIdentifier>{3fb0e907-a078-4943-ab94-631783b69f75}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\autofit">
<UniqueIdentifier>{61b2d9d3-2578-438e-bbf2-52b3a0f60001}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="freetype\src\winfonts\fnterrs.h">
<Filter>Source Files\winfnt</Filter>
</ClInclude>
<ClInclude Include="freetype\src\winfonts\winfnt.h">
<Filter>Source Files\winfnt</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="freetype\src\winfonts\winfnt.c">
<Filter>Source Files\winfnt</Filter>
</ClCompile>
<ClCompile Include="freetype\src\base\ftbase.c">
<Filter>Source Files\base</Filter>
</ClCompile>
<ClCompile Include="freetype\src\base\ftsystem.c">
<Filter>Source Files\base</Filter>
</ClCompile>
<ClCompile Include="freetype\src\base\ftinit.c">
<Filter>Source Files\base</Filter>
</ClCompile>
<ClCompile Include="freetype\src\truetype\truetype.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\autofit\autofit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\type1\type1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\cff\cff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\cid\type1cid.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\pfr\pfr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\pcf\pcf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\type42\type42.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\psaux\psaux.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\psnames\psnames.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\pshinter\pshinter.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\raster\raster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\sfnt\sfnt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\smooth\smooth.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\gzip\ftgzip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\lzw\ftlzw.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\base\ftbitmap.c">
<Filter>Source Files\base</Filter>
</ClCompile>
<ClCompile Include="freetype\src\bdf\bdf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="freetype\src\base\ftdebug.c">
<Filter>Source Files\base</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IncludePath>$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>FT2_BUILD_LIBRARY;DLL_EXPORT;_WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

View File

@@ -0,0 +1,534 @@
# CMakeLists.txt
#
# Copyright (C) 2013-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# Written originally by John Cary <cary@txcorp.com>
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
#
#
# The following will 1. create a build directory and 2. change into it and
# call cmake to configure the build with default parameters as a static
# library.
#
# cmake -E make_directory build
# cmake -E chdir build cmake ..
#
# For a dynamic library, use
#
# cmake -E chdir build cmake -D BUILD_SHARED_LIBS:BOOL=true ..
#
# For a framework on OS X, use
#
# cmake -E chdir build cmake -G Xcode -D BUILD_FRAMEWORK:BOOL=true ..
#
# For an iOS static library, use
#
# cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=OS ..
#
# or
#
# cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=SIMULATOR ..
#
# or
#
# cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=SIMULATOR64 ..
#
# Finally, build the project with:
#
# cmake --build build
#
# Install it with
#
# (sudo) cmake --build build --target install
#
# A binary distribution can be made with
#
# cmake --build build --config Release --target package
#
# Please refer to the cmake manual for further options, in particular, how
# to modify compilation and linking parameters.
#
# Some notes.
#
# . `cmake' creates configuration files in
#
# <build-directory>/include/freetype/config
#
# which should be further modified if necessary.
#
# . You can use `cmake' directly on a freshly cloned FreeType git
# repository.
#
# . `CMakeLists.txt' is provided as-is since it is normally not used by the
# developer team.
#
# . Set the `FT_WITH_ZLIB', `FT_WITH_BZIP2', `FT_WITH_PNG', and
# `FT_WITH_HARFBUZZ' CMake variables to `ON' to force using a dependency.
# Leave a variable undefined (which is the default) to use the dependency
# only if it is available. Set `CMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE' to
# disable a dependency completely (CMake package name, so `BZip2' instead of
# `BZIP2'). Example:
#
# cmake -DFT_WITH_ZLIB=ON -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE [...]
#
# . Installation of FreeType can be controlled with the CMake variables
# `SKIP_INSTALL_HEADERS', `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL'
# (this is compatible with the same CMake variables in zlib's CMake
# support).
# FreeType explicitly marks the API to be exported and relies on the compiler
# to hide all other symbols. CMake supports a C_VISBILITY_PRESET property
# starting with 2.8.12.
cmake_minimum_required(VERSION 2.8.12)
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
# Allow symbol visibility settings also on static libraries. CMake < 3.3
# only sets the propery on a shared library build.
cmake_policy(SET CMP0063 NEW)
endif ()
include(CheckIncludeFile)
# CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which
# configures the base build environment and references the toolchain file
if (APPLE)
if (DEFINED IOS_PLATFORM)
if (NOT "${IOS_PLATFORM}" STREQUAL "OS"
AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR"
AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR64")
message(FATAL_ERROR
"IOS_PLATFORM must be set to either OS, SIMULATOR, or SIMULATOR64")
endif ()
if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
message(AUTHOR_WARNING
"You should use Xcode generator with IOS_PLATFORM enabled to get Universal builds.")
endif ()
if (BUILD_SHARED_LIBS)
message(FATAL_ERROR
"BUILD_SHARED_LIBS can not be on with IOS_PLATFORM enabled")
endif ()
if (BUILD_FRAMEWORK)
message(FATAL_ERROR
"BUILD_FRAMEWORK can not be on with IOS_PLATFORM enabled")
endif ()
# iOS only uses static libraries
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_TOOLCHAIN_FILE
${CMAKE_SOURCE_DIR}/builds/cmake/iOS.cmake)
endif ()
else ()
if (DEFINED IOS_PLATFORM)
message(FATAL_ERROR "IOS_PLATFORM is not supported on this platform")
endif ()
endif ()
project(freetype C)
set(VERSION_MAJOR "2")
set(VERSION_MINOR "10")
set(VERSION_PATCH "1")
# SOVERSION scheme: CURRENT.AGE.REVISION
# If there was an incompatible interface change:
# Increment CURRENT. Set AGE and REVISION to 0
# If there was a compatible interface change:
# Increment AGE. Set REVISION to 0
# If the source code was changed, but there were no interface changes:
# Increment REVISION.
set(LIBRARY_VERSION "6.16.0")
set(LIBRARY_SOVERSION "6")
# These options mean "require x and complain if not found". They'll get
# optionally found anyway. Use `-DCMAKE_DISABLE_FIND_PACKAGE_x=TRUE` to disable
# searching for a packge entirely (x is the CMake package name, so "BZip2"
# instead of "BZIP2").
option(FT_WITH_ZLIB "Use system zlib instead of internal library." OFF)
option(FT_WITH_BZIP2 "Support bzip2 compressed fonts." OFF)
option(FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF)
option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." OFF)
# Disallow in-source builds
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
message(FATAL_ERROR
"In-source builds are not permitted! Make a separate folder for"
" building, e.g.,\n"
" cmake -E make_directory build\n"
" cmake -E chdir build cmake ..\n"
"Before that, remove the files created by this failed run with\n"
" cmake -E remove CMakeCache.txt\n"
" cmake -E remove_directory CMakeFiles")
endif ()
# Add local cmake modules
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/builds/cmake)
if (BUILD_FRAMEWORK)
if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
message(FATAL_ERROR
"You should use Xcode generator with BUILD_FRAMEWORK enabled")
endif ()
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)")
set(BUILD_SHARED_LIBS ON)
endif ()
# Find dependencies
if (FT_WITH_HARFBUZZ)
find_package(HarfBuzz 1.3.0 REQUIRED)
else ()
find_package(HarfBuzz 1.3.0)
endif ()
if (FT_WITH_PNG)
find_package(PNG REQUIRED)
else ()
find_package(PNG)
endif ()
if (FT_WITH_ZLIB)
find_package(ZLIB REQUIRED)
else ()
find_package(ZLIB)
endif ()
if (FT_WITH_BZIP2)
find_package(BZip2 REQUIRED)
else ()
find_package(BZip2)
endif ()
# Create the configuration file
if (UNIX)
check_include_file("unistd.h" HAVE_UNISTD_H)
check_include_file("fcntl.h" HAVE_FCNTL_H)
check_include_file("stdint.h" HAVE_STDINT_H)
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in"
FTCONFIG_H)
if (HAVE_UNISTD_H)
string(REGEX REPLACE
"#undef +(HAVE_UNISTD_H)" "#define \\1 1"
FTCONFIG_H "${FTCONFIG_H}")
endif ()
if (HAVE_FCNTL_H)
string(REGEX REPLACE
"#undef +(HAVE_FCNTL_H)" "#define \\1 1"
FTCONFIG_H "${FTCONFIG_H}")
endif ()
if (HAVE_STDINT_H)
string(REGEX REPLACE
"#undef +(HAVE_STDINT_H)" "#define \\1 1"
FTCONFIG_H "${FTCONFIG_H}")
endif ()
string(REPLACE "/undef " "#undef "
FTCONFIG_H "${FTCONFIG_H}")
else ()
file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
FTCONFIG_H)
endif ()
set(FTCONFIG_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h")
if (EXISTS "${FTCONFIG_H_NAME}")
file(READ "${FTCONFIG_H_NAME}" ORIGINAL_FTCONFIG_H)
else ()
set(ORIGINAL_FTCONFIG_H "")
endif ()
if (NOT (ORIGINAL_FTCONFIG_H STREQUAL FTCONFIG_H))
file(WRITE "${FTCONFIG_H_NAME}" "${FTCONFIG_H}")
endif ()
# Create the options file
file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftoption.h"
FTOPTION_H)
if (ZLIB_FOUND)
string(REGEX REPLACE
"/\\* +(#define +FT_CONFIG_OPTION_SYSTEM_ZLIB) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
endif ()
if (BZIP2_FOUND)
string(REGEX REPLACE
"/\\* +(#define +FT_CONFIG_OPTION_USE_BZIP2) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
endif ()
if (PNG_FOUND)
string(REGEX REPLACE
"/\\* +(#define +FT_CONFIG_OPTION_USE_PNG) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
endif ()
if (HARFBUZZ_FOUND)
string(REGEX REPLACE
"/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
endif ()
set(FTOPTION_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h")
if (EXISTS "${FTOPTION_H_NAME}")
file(READ "${FTOPTION_H_NAME}" ORIGINAL_FTOPTION_H)
else ()
set(ORIGINAL_FTOPTION_H "")
endif ()
if (NOT (ORIGINAL_FTOPTION_H STREQUAL FTOPTION_H))
file(WRITE "${FTOPTION_H_NAME}" "${FTOPTION_H}")
endif ()
file(GLOB PUBLIC_HEADERS "include/ft2build.h" "include/freetype/*.h")
file(GLOB PUBLIC_CONFIG_HEADERS "include/freetype/config/*.h")
file(GLOB PRIVATE_HEADERS "include/freetype/internal/*.h")
set(BASE_SRCS
src/autofit/autofit.c
src/base/ftbase.c
src/base/ftbbox.c
src/base/ftbdf.c
src/base/ftbitmap.c
src/base/ftcid.c
src/base/ftfstype.c
src/base/ftgasp.c
src/base/ftglyph.c
src/base/ftgxval.c
src/base/ftinit.c
src/base/ftmm.c
src/base/ftotval.c
src/base/ftpatent.c
src/base/ftpfr.c
src/base/ftstroke.c
src/base/ftsynth.c
src/base/ftsystem.c
src/base/fttype1.c
src/base/ftwinfnt.c
src/bdf/bdf.c
src/bzip2/ftbzip2.c
src/cache/ftcache.c
src/cff/cff.c
src/cid/type1cid.c
src/gzip/ftgzip.c
src/lzw/ftlzw.c
src/pcf/pcf.c
src/pfr/pfr.c
src/psaux/psaux.c
src/pshinter/pshinter.c
src/psnames/psnames.c
src/raster/raster.c
src/sfnt/sfnt.c
src/smooth/smooth.c
src/truetype/truetype.c
src/type1/type1.c
src/type42/type42.c
src/winfonts/winfnt.c
)
if (WIN32)
enable_language(RC)
list(APPEND BASE_SRCS builds/windows/ftdebug.c
src/base/ftver.rc)
elseif (WINCE)
list(APPEND BASE_SRCS builds/wince/ftdebug.c)
else ()
list(APPEND BASE_SRCS src/base/ftdebug.c)
endif ()
if (BUILD_FRAMEWORK)
list(APPEND BASE_SRCS builds/mac/freetype-Info.plist)
endif ()
if (NOT DISABLE_FORCE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX d)
endif ()
add_library(freetype
${PUBLIC_HEADERS}
${PUBLIC_CONFIG_HEADERS}
${PRIVATE_HEADERS}
${BASE_SRCS}
)
set_target_properties(
freetype PROPERTIES
C_VISIBILITY_PRESET hidden)
target_compile_definitions(
freetype PRIVATE FT2_BUILD_LIBRARY)
if (WIN32)
target_compile_definitions(
freetype PRIVATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS)
if (BUILD_SHARED_LIBS)
target_compile_definitions(
freetype PRIVATE DLL_EXPORT)
endif ()
endif ()
if (BUILD_SHARED_LIBS)
set_target_properties(freetype PROPERTIES
VERSION ${LIBRARY_VERSION}
SOVERSION ${LIBRARY_SOVERSION})
endif ()
# Pick up ftconfig.h and ftoption.h generated above, first.
target_include_directories(
freetype
PUBLIC
$<INSTALL_INTERFACE:include/freetype2>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/include)
if (BUILD_FRAMEWORK)
set_property(SOURCE ${PUBLIC_CONFIG_HEADERS}
PROPERTY MACOSX_PACKAGE_LOCATION Headers/config
)
set_target_properties(freetype PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_INFO_PLIST builds/mac/freetype-Info.plist
PUBLIC_HEADER "${PUBLIC_HEADERS}"
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
)
endif ()
set(PKG_CONFIG_REQUIRED_PRIVATE "")
if (ZLIB_FOUND)
target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS})
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE zlib)
endif ()
if (BZIP2_FOUND)
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE bzip2)
endif ()
if (PNG_FOUND)
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS})
target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE libpng)
endif ()
if (HARFBUZZ_FOUND)
target_link_libraries(freetype PRIVATE ${HARFBUZZ_LIBRARIES})
target_include_directories(freetype PRIVATE ${HARFBUZZ_INCLUDE_DIRS})
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE harfbuzz)
endif ()
# Installation
include(GNUInstallDirs)
if (NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
install(
# Note the trailing slash in the argument to `DIRECTORY'!
DIRECTORY ${PROJECT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/freetype2
COMPONENT headers
PATTERN "internal" EXCLUDE
PATTERN "ftconfig.h" EXCLUDE
PATTERN "ftoption.h" EXCLUDE)
install(
FILES ${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h
${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/freetype2/freetype/config
COMPONENT headers)
endif ()
if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
# Generate the pkg-config file
if (UNIX)
file(READ ${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in FREETYPE2_PC_IN)
string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}")
string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX}
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%exec_prefix%" "\${prefix}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%libdir%" "\${prefix}/${CMAKE_INSTALL_LIBDIR}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%includedir%" "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%ft_version%" "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%REQUIRES_PRIVATE%" "${PKG_CONFIG_REQUIRED_PRIVATE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%LIBS_PRIVATE%" "" # All libs support pkg-config
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
if (EXISTS "${FREETYPE2_PC_IN_NAME}")
file(READ "${FREETYPE2_PC_IN_NAME}" ORIGINAL_FREETYPE2_PC_IN)
else ()
set(ORIGINAL_FREETYPE2_PC_IN "")
endif ()
if (NOT (ORIGINAL_FREETYPE2_PC_IN STREQUAL FREETYPE2_PC_IN))
file(WRITE "${FREETYPE2_PC_IN_NAME}" ${FREETYPE2_PC_IN})
endif ()
install(
FILES ${PROJECT_BINARY_DIR}/freetype2.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT pkgconfig)
endif ()
install(
TARGETS freetype
EXPORT freetype-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
FRAMEWORK DESTINATION Library/Frameworks
COMPONENT libraries)
install(
EXPORT freetype-targets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype
FILE freetype-config.cmake
COMPONENT headers)
endif ()
# Packaging
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The FreeType font rendering library.")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/docs/LICENSE.TXT")
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
if (WIN32)
set(CPACK_GENERATOR ZIP)
else ()
set(CPACK_GENERATOR TGZ)
endif ()
set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C/C++ Headers")
set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION
"Library used to build programs which use FreeType")
set(CPACK_COMPONENT_HEADERS_DESCRIPTION
"C/C++ header files for use with FreeType")
set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
set(CPACK_COMPONENT_LIBRARIES_GROUP "Development")
set(CPACK_COMPONENT_HEADERS_GROUP "Development")
include(CPack)

3120
FreeType/freetype/ChangeLog Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

223
FreeType/freetype/Jamfile Normal file
View File

@@ -0,0 +1,223 @@
# FreeType 2 top Jamfile.
#
# Copyright (C) 2001-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
# The HDRMACRO is already defined in FTJam and is used to add
# the content of certain macros to the list of included header
# files.
#
# We can compile FreeType 2 with classic Jam however thanks to
# the following code
#
if ! $(JAM_TOOLSET)
{
rule HDRMACRO
{
# nothing
}
}
# We need to invoke a SubDir rule if the FT2 source directory top is not the
# current directory. This allows us to build FreeType 2 as part of a larger
# project easily.
#
if $(FT2_TOP) != $(DOT)
{
SubDir FT2_TOP ;
}
# The following macros define the include directory, the source directory,
# and the final library name (without library extensions). They can be
# replaced by other definitions when the library is compiled as part of
# a larger project.
#
# Name of FreeType include directory during compilation.
# This is relative to FT2_TOP.
#
FT2_INCLUDE_DIR ?= include ;
# Name of FreeType source directory during compilation.
# This is relative to FT2_TOP.
#
FT2_SRC_DIR ?= src ;
# Name of final library, without extension.
#
FT2_LIB ?= $(LIBPREFIX)freetype ;
# Define FT2_BUILD_INCLUDE to point to your build-specific directory.
# This is prepended to FT2_INCLUDE_DIR. It can be used to specify
# the location of a custom <ft2build.h> which will point to custom
# versions of `ftmodule.h' and `ftoption.h', for example.
#
FT2_BUILD_INCLUDE ?= ;
# The list of modules to compile on any given build of the library.
# By default, this will contain _all_ modules defined in FT2_SRC_DIR.
#
# IMPORTANT: You'll need to change the content of `ftmodule.h' as well
# if you modify this list or provide your own.
#
FT2_COMPONENTS ?= autofit # auto-fitter
base # base component (public APIs)
bdf # BDF font driver
bzip2 # support for bzip2-compressed PCF font
cache # cache sub-system
cff # CFF/CEF font driver
cid # PostScript CID-keyed font driver
gzip # support for gzip-compressed PCF font
lzw # support for LZW-compressed PCF font
pcf # PCF font driver
pfr # PFR/TrueDoc font driver
psaux # common PostScript routines module
pshinter # PostScript hinter module
psnames # PostScript names handling
raster # monochrome rasterizer
sfnt # SFNT-based format support routines
smooth # anti-aliased rasterizer
truetype # TrueType font driver
type1 # PostScript Type 1 font driver
type42 # PostScript Type 42 (embedded TrueType) driver
winfonts # Windows FON/FNT font driver
;
# Don't touch.
#
FT2_INCLUDE = $(FT2_BUILD_INCLUDE)
[ FT2_SubDir $(FT2_INCLUDE_DIR) ] ;
FT2_SRC = [ FT2_SubDir $(FT2_SRC_DIR) ] ;
# Location of API Reference Documentation
#
if $(DOC_DIR)
{
DOC_DIR = $(DOCDIR:T) ;
}
else
{
DOC_DIR = docs/reference ;
}
# Only used by FreeType developers.
#
if $(DEBUG_HINTER)
{
CCFLAGS += -DDEBUG_HINTER ;
}
# We need `include' in the current include path in order to
# compile any part of FreeType 2.
#
HDRS += $(FT2_INCLUDE) ;
# We need to #define FT2_BUILD_LIBRARY so that our sources find the
# internal headers
#
CCFLAGS += -DFT2_BUILD_LIBRARY ;
# Uncomment the following line if you want to build individual source files
# for each FreeType 2 module. This is only useful during development, and
# is better defined as an environment variable anyway!
#
# FT2_MULTI = true ;
# The files `ftheader.h', `internal.h', and `ftserv.h' are used to define
# macros that are later used in #include statements. They need to be parsed
# in order to record these definitions.
#
HDRMACRO [ FT2_SubDir $(FT2_INCLUDE_DIR) freetype config ftheader.h ] ;
HDRMACRO [ FT2_SubDir $(FT2_INCLUDE_DIR) freetype internal internal.h ] ;
HDRMACRO [ FT2_SubDir $(FT2_INCLUDE_DIR) freetype internal ftserv.h ] ;
# Now include the Jamfile in `freetype2/src', used to drive the compilation
# of each FreeType 2 component and/or module.
#
SubInclude FT2_TOP $(FT2_SRC_DIR) ;
# Handle the generation of the `ftexport.sym' file, which contains the list
# of exported symbols. This can be used on Unix by libtool.
#
SubInclude FT2_TOP $(FT2_SRC_DIR) tools ;
rule GenExportSymbols
{
local apinames = apinames$(SUFEXE) ;
local aheader ;
local headers ;
for aheader in [ Glob $(2) : *.h ]
{
switch $(aheader)
{
case */ftmac.h :
if ( $(MAC) || $(OS) = MACOSX ) {
headers += $(aheader) ;
}
case *.h : headers += $(aheader) ;
}
}
LOCATE on $(1) = $(ALL_LOCATE_TARGET) ;
APINAMES on $(1) = apinames$(SUFEXE) ;
Depends $(1) : $(apinames) $(headers) ;
GenExportSymbols1 $(1) : $(headers) ;
Clean clean : $(1) ;
}
actions GenExportSymbols1 bind APINAMES
{
$(APINAMES) $(2) > $(1)
}
GenExportSymbols ftexport.sym : include/freetype ;
# Test files (hinter debugging). Only used by FreeType developers.
#
if $(DEBUG_HINTER)
{
SubInclude FT2_TOP tests ;
}
rule RefDoc
{
Depends $1 : all ;
NotFile $1 ;
Always $1 ;
}
actions RefDoc
{
python -m docwriter
--prefix=ft2
--title=FreeType-2.10.1
--output=$(DOC_DIR)
$(FT2_INCLUDE)/freetype/*.h
$(FT2_INCLUDE)/freetype/config/*.h
$(FT2_INCLUDE)/freetype/cache/*.h
}
RefDoc refdoc ;
# end of top Jamfile

View File

@@ -0,0 +1,71 @@
# FreeType 2 JamRules.
#
# Copyright (C) 2001-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
# This file contains the Jam rules needed to build the FreeType 2 library.
# It is shared by all Jamfiles and is included only once in the build
# process.
#
# Call SubDirHdrs on a list of directories.
#
rule AddSubDirHdrs
{
local x ;
for x in $(<)
{
SubDirHdrs $(x) ;
}
}
# Determine prefix of library file. We must use "libxxxxx" on Unix systems,
# while all other simply use the real name.
#
if $(UNIX)
{
LIBPREFIX ?= lib ;
}
else
{
LIBPREFIX ?= "" ;
}
# FT2_TOP contains the location of the FreeType source directory. You can
# set it to a specific value if you want to compile the library as part of a
# larger project.
#
FT2_TOP ?= $(DOT) ;
# Define a new rule used to declare a sub directory of the Nirvana source
# tree.
#
rule FT2_SubDir
{
if $(FT2_TOP) = $(DOT)
{
return [ FDirName $(<) ] ;
}
else
{
return [ FDirName $(FT2_TOP) $(<) ] ;
}
}
# We also set ALL_LOCATE_TARGET in order to place all object and library
# files in "objs".
#
ALL_LOCATE_TARGET ?= [ FT2_SubDir objs ] ;
# end of Jamrules

View File

@@ -0,0 +1,34 @@
#
# FreeType 2 build system -- top-level Makefile
#
# Copyright (C) 1996-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
# Project names
#
PROJECT := freetype
PROJECT_TITLE := FreeType
# The variable TOP_DIR holds the path to the topmost directory in the project
# engine source hierarchy. If it is not defined, default it to `.'.
#
TOP_DIR ?= .
# The variable OBJ_DIR gives the location where object files and the
# FreeType library are built.
#
OBJ_DIR ?= $(TOP_DIR)/objs
include $(TOP_DIR)/builds/toplevel.mk
# EOF

84
FreeType/freetype/README Normal file
View File

@@ -0,0 +1,84 @@
FreeType 2.10.1
===============
Homepage: https://www.freetype.org
FreeType is a freely available software library to render fonts.
It is written in C, designed to be small, efficient, highly
customizable, and portable while capable of producing high-quality
output (glyph images) of most vector and bitmap font formats.
Please read the docs/CHANGES file, it contains IMPORTANT
INFORMATION.
Read the files `docs/INSTALL*' for installation instructions; see
the file `docs/LICENSE.TXT' for the available licenses.
The FreeType 2 API reference is located in `docs/reference/site';
use the file `index.html' as the top entry point. Additional
documentation is available as a separate package from our sites. Go
to
https://download.savannah.gnu.org/releases/freetype/
and download one of the following files.
freetype-doc-2.10.1.tar.xz
freetype-doc-2.10.1.tar.gz
ftdoc2101.zip
To view the documentation online, go to
https://www.freetype.org/freetype2/docs/
Mailing Lists
=============
The preferred way of communication with the FreeType team is using
e-mail lists.
general use and discussion: freetype@nongnu.org
engine internals, porting, etc.: freetype-devel@nongnu.org
announcements: freetype-announce@nongnu.org
git repository tracker: freetype-commit@nongnu.org
The lists are moderated; see
https://www.freetype.org/contact.html
how to subscribe.
Bugs
====
Please submit bug reports at
https://savannah.nongnu.org/bugs/?group=freetype
Alternatively, you might report bugs by e-mail to
`freetype-devel@nongnu.org'. Don't forget to send a detailed
explanation of the problem -- there is nothing worse than receiving
a terse message that only says `it doesn't work'.
Enjoy!
The FreeType Team
----------------------------------------------------------------------
Copyright (C) 2006-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
modified, and distributed under the terms of the FreeType project
license, LICENSE.TXT. By continuing to use, modify, or distribute
this file you indicate that you have read the license and understand
and accept it fully.
--- end of README ---

View File

@@ -0,0 +1,50 @@
The git archive doesn't contain pre-built configuration scripts for
UNIXish platforms. To generate them say
sh autogen.sh
which in turn depends on the following packages:
automake (1.10.1)
libtool (2.2.4)
autoconf (2.62)
The versions given in parentheses are known to work. Newer versions
should work too, of course. Note that autogen.sh also sets up proper
file permissions for the `configure' and auxiliary scripts.
The autogen.sh script now checks the version of above three packages
whether they match the numbers above. Otherwise it will complain and
suggest either upgrading or using an environment variable to point to
a more recent version of the required tool(s).
Note that `aclocal' is provided by the `automake' package on Linux,
and that `libtoolize' is called `glibtoolize' on Darwin (OS X).
For static builds which don't use platform specific optimizations, no
configure script is necessary at all; saying
make setup ansi
make
should work on all platforms which have GNU make (or makepp).
Similarly, a build with `cmake' can be done directly from the git
repository.
----------------------------------------------------------------------
Copyright (C) 2005-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
modified, and distributed under the terms of the FreeType project
license, LICENSE.TXT. By continuing to use, modify, or distribute
this file you indicate that you have read the license and understand
and accept it fully.
--- end of README.git ---

View File

@@ -0,0 +1,165 @@
#!/bin/sh
# Copyright (C) 2005-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
run ()
{
echo "running \`$*'"
eval $*
if test $? != 0 ; then
echo "error while running \`$*'"
exit 1
fi
}
get_major_version ()
{
echo $1 | sed -e 's/\([0-9][0-9]*\)\..*/\1/g'
}
get_minor_version ()
{
echo $1 | sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/g'
}
get_patch_version ()
{
# tricky: some version numbers don't include a patch
# separated with a point, but something like 1.4-p6
patch=`echo $1 | sed -e 's/[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/g'`
if test "$patch" = "$1"; then
patch=`echo $1 | sed -e 's/[0-9][0-9]*\.[0-9][0-9]*\-p\([0-9][0-9]*\).*/\1/g'`
# if there isn't any patch number, default to 0
if test "$patch" = "$1"; then
patch=0
fi
fi
echo $patch
}
# $1: version to check
# $2: minimum version
compare_to_minimum_version ()
{
MAJOR1=`get_major_version $1`
MAJOR2=`get_major_version $2`
if test $MAJOR1 -lt $MAJOR2; then
echo 0
return
else
if test $MAJOR1 -gt $MAJOR2; then
echo 1
return
fi
fi
MINOR1=`get_minor_version $1`
MINOR2=`get_minor_version $2`
if test $MINOR1 -lt $MINOR2; then
echo 0
return
else
if test $MINOR1 -gt $MINOR2; then
echo 1
return
fi
fi
PATCH1=`get_patch_version $1`
PATCH2=`get_patch_version $2`
if test $PATCH1 -lt $PATCH2; then
echo 0
else
echo 1
fi
}
# check the version of a given tool against a minimum version number
#
# $1: tool path
# $2: tool usual name (e.g. `aclocal')
# $3: tool variable (e.g. `ACLOCAL')
# $4: minimum version to check against
# $5: option field index used to extract the tool version from the
# output of --version
check_tool_version ()
{
field=$5
# assume the output of "[TOOL] --version" is "toolname (GNU toolname foo bar) version"
if test "$field"x = x; then
field=3 # default to 3 for all GNU autotools, after filtering enclosed string
fi
version=`$1 --version | head -1 | sed 's/([^)]*)/()/g' | cut -d ' ' -f $field`
version_check=`compare_to_minimum_version $version $4`
if test "$version_check"x = 0x; then
echo "ERROR: Your version of the \`$2' tool is too old."
echo " Minimum version $4 is required (yours is version $version)."
echo " Please upgrade or use the $3 variable to point to a more recent one."
echo ""
exit 1
fi
}
if test ! -f ./builds/unix/configure.raw; then
echo "You must be in the same directory as \`autogen.sh'."
echo "Bootstrapping doesn't work if srcdir != builddir."
exit 1
fi
# On MacOS X, the GNU libtool is named `glibtool'.
HOSTOS=`uname`
if test "$LIBTOOLIZE"x != x; then
:
elif test "$HOSTOS"x = Darwinx; then
LIBTOOLIZE=glibtoolize
else
LIBTOOLIZE=libtoolize
fi
if test "$ACLOCAL"x = x; then
ACLOCAL=aclocal
fi
if test "$AUTOCONF"x = x; then
AUTOCONF=autoconf
fi
check_tool_version $ACLOCAL aclocal ACLOCAL 1.10.1
check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4
check_tool_version $AUTOCONF autoconf AUTOCONF 2.62
# This sets freetype_major, freetype_minor, and freetype_patch.
eval `sed -nf version.sed include/freetype/freetype.h`
# We set freetype-patch to an empty value if it is zero.
if test "$freetype_patch" = ".0"; then
freetype_patch=
fi
cd builds/unix
echo "generating \`configure.ac'"
sed -e "s;@VERSION@;$freetype_major$freetype_minor$freetype_patch;" \
< configure.raw > configure.ac
run aclocal -I . --force
run $LIBTOOLIZE --force --copy --install
run autoconf --force
chmod +x install-sh
cd ../..
chmod +x ./configure
# EOF

View File

@@ -0,0 +1,110 @@
README for the builds/amiga subdirectory.
Copyright (C) 2005-2019 by
Werner Lemberg and Detlef Würkner.
This file is part of the FreeType project, and may only be used, modified,
and distributed under the terms of the FreeType project license,
LICENSE.TXT. By continuing to use, modify, or distribute this file you
indicate that you have read the license and understand and accept it
fully.
The makefile.os4 is for the AmigaOS4 SDK. To use it, type
"make -f makefile.os4", it produces a link library libft2_ppc.a.
The makefile is for ppc-morphos-gcc-2.95.3-bin.tgz (gcc 2.95.3 hosted on
68k-Amiga producing MorphOS-PPC-binaries from http://www.morphos.de).
To use it, type "make assign", then "make"; it produces a link library
libft2_ppc.a.
The smakefile is a makefile for Amiga SAS/C 6.58 (no longer available,
latest sold version was 6.50, updates can be found in Aminet). It is
based on the version found in the sourcecode of ttf.library 0.83b for
FreeType 1.3.1 from Richard Griffith (ragriffi@sprynet.com,
http://ragriffi.home.sprynet.com).
You will also need the latest include files and amiga.lib from the
Amiga web site (https://os.amigaworld.de/download.php?id=3) for
AmigaOS 3.9; the generated code should work under AmigaOS 2.04 and up.
To use it, call "smake assign" and then "smake" from the builds/amiga
directory. The results are:
- A link library "ft2_680x0.lib" (where x depends on the setting of
the CPU entry in the smakefile) containing all FreeType2 parts
except of the init code, debugging code, and the system interface
code.
- ftsystem.o, an object module containing the standard version of the
system interface code which uses fopen() fclose() fread() fseek()
ftell() malloc() realloc() and free() from lib:sc.lib (not pure).
- ftsystempure.o, an object module containing the pure version of the
system interface code which uses Open() Close() Read() Seek()
ExamineFH() AsmAllocPooled() AsmFreePooled() etc. This version can
be used in both normal programs and in Amiga run-time shared system
librarys (can be linked with lib:libinit.o, no copying of DATA and
BSS hunks for each OpenLibrary() necessary). Source code is in
src/base/ftsystem.c.
- ftdebug.o, an object module containing the standard version of the
debugging code which uses vprintf() and exit() (not pure).
Debugging can be turned on in FT:include/freetype/config/ftoption.h
and with FT_SetTraceLevel().
- ftdebugpure.o, an object module containing the pure version of the
debugging code which uses KVPrintf() from lib:debug.lib and no
exit(). For debugging of Amiga run-time shared system libraries.
Source code is in src/base/ftdebug.c.
- NO ftinit.o. Because linking with a link library should result in
linking only the needed object modules in it, but standard
ftsystem.o would force ALL FreeType2 modules to be linked to your
program, I decided to use a different scheme: You must #include
FT:src/base/ftinit.c in your sourcecode and specify with #define
statements which modules you need. See
include/freetype/config/ftmodule.h.
To use in your own programs:
- Insert the #define and #include statements from top of
include/freetype/config/ftmodule.h in your source code and
uncomment the #define statements for the FreeType2 modules you need.
- You can use either PARAMETERS=REGISTER or PARAMETERS=STACK for
calling the FreeType2 functions, because the link library and the
object files are compiled with PARAMETERS=BOTH.
- "smake assign" (assign "FT:" to the FreeType2 main directory).
- Compile your program.
- Link with either ftsystem.o or ftsystempure.o, if debugging enabled
with either ftdebug.o or (ftdebugpure.o and lib:debug.lib), and with
ft2_680x0.lib as link library.
To adapt to other compilers:
- The standard ANSI C maximum length of 31 significant characters in
identifiers is not enough for FreeType2. Check if your compiler has
a minimum length of 40 significant characters or can be switched to
it. "idlen=40" is the option for SAS/C. Setting #define
HAVE_LIMIT_ON_IDENTS in an include file may also work (not tested).
- Make sure that the include directory in builds/amiga is searched
before the normal FreeType2 include directory, so you are able to
replace problematic include files with your own version (same may be
useful for the src directory).
- An example of how to replace/workaround a problematic include file
is include/freetype/config/ftconfig.h; it changes a #define that
would prevent SAS/C from generating XDEF's where it should do that and
then includes the standard FreeType2 include file.
Local Variables:
coding: latin-1
End:

Some files were not shown because too many files have changed in this diff Show More