Compare commits

...

62 Commits
0.0.3 ... 1.0a2

Author SHA1 Message Date
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
251 changed files with 8369 additions and 3725 deletions

View File

@@ -1,7 +1,3 @@
Roboto font:
(c)2011 Google
Distributed under the Apache License (see Resources/Fonts/Roboto/LICENSE)
Open Sans font:
(c)2011 Google
Distributed under the Apache License (see Resources/Fonts/OpenSans/LICENSE)
@@ -17,6 +13,12 @@ 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)

View File

@@ -41,166 +41,94 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bin2gp", "bin2gp\bin2gp.vcx
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
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
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}.Debug|x86.ActiveCfg = Debug|Win32
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Debug|x86.Build.0 = Debug|Win32
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Release|x64.ActiveCfg = Release|x64
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Release|x64.Build.0 = Release|x64
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Release|x86.ActiveCfg = Release|Win32
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Debug|x86.Build.0 = Debug|Win32
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Release|x64.ActiveCfg = Release|x64
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Release|x64.Build.0 = Release|x64
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Release|x86.ActiveCfg = Release|Win32
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Debug|x86.Build.0 = Debug|Win32
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Release|x64.ActiveCfg = Release|x64
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Release|x64.Build.0 = Release|x64
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Release|x86.ActiveCfg = Release|Win32
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Debug|x86.Build.0 = Debug|Win32
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Release|x64.ActiveCfg = Release|x64
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Release|x64.Build.0 = Release|x64
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Release|x86.ActiveCfg = Release|Win32
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Debug|x86.Build.0 = Debug|Win32
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Release|x64.ActiveCfg = Release|x64
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Release|x64.Build.0 = Release|x64
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Release|x86.ActiveCfg = Release|Win32
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Debug|x86.Build.0 = Debug|Win32
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Release|x64.ActiveCfg = Release|x64
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Release|x64.Build.0 = Release|x64
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Release|x86.ActiveCfg = Release|Win32
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Debug|x86.Build.0 = Debug|Win32
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Release|x64.ActiveCfg = Release|x64
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Release|x64.Build.0 = Release|x64
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Release|x86.ActiveCfg = Release|Win32
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Debug|x86.Build.0 = Debug|Win32
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Release|x64.ActiveCfg = Release|x64
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Release|x64.Build.0 = Release|x64
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Release|x86.ActiveCfg = Release|Win32
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Debug|x86.Build.0 = Debug|Win32
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Release|x64.ActiveCfg = Release|x64
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Release|x64.Build.0 = Release|x64
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Release|x86.ActiveCfg = Release|Win32
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Debug|x86.Build.0 = Debug|Win32
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Release|x64.ActiveCfg = Release|x64
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Release|x64.Build.0 = Release|x64
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Release|x86.ActiveCfg = Release|Win32
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{B852D549-4020-4477-8BFB-E199FF78B047}.Debug|x86.Build.0 = Debug|Win32
{B852D549-4020-4477-8BFB-E199FF78B047}.Release|x64.ActiveCfg = Release|x64
{B852D549-4020-4477-8BFB-E199FF78B047}.Release|x64.Build.0 = Release|x64
{B852D549-4020-4477-8BFB-E199FF78B047}.Release|x86.ActiveCfg = Release|Win32
{B852D549-4020-4477-8BFB-E199FF78B047}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Debug|x86.Build.0 = Debug|Win32
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Release|x64.ActiveCfg = Release|x64
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Release|x64.Build.0 = Release|x64
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Release|x86.ActiveCfg = Release|Win32
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Debug|x86.Build.0 = Debug|Win32
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Release|x64.ActiveCfg = Release|x64
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Release|x64.Build.0 = Release|x64
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Release|x86.ActiveCfg = Release|Win32
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Debug|x86.Build.0 = Debug|Win32
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Release|x64.ActiveCfg = Release|x64
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Release|x64.Build.0 = Release|x64
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Release|x86.ActiveCfg = Release|Win32
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Debug|x86.Build.0 = Debug|Win32
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Release|x64.ActiveCfg = Release|x64
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Release|x64.Build.0 = Release|x64
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Release|x86.ActiveCfg = Release|Win32
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Debug|x86.Build.0 = Debug|Win32
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Release|x64.ActiveCfg = Release|x64
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Release|x64.Build.0 = Release|x64
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Release|x86.ActiveCfg = Release|Win32
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Debug|x86.Build.0 = Debug|Win32
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Release|x64.ActiveCfg = Release|x64
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Release|x64.Build.0 = Release|x64
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Release|x86.ActiveCfg = Release|Win32
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Debug|x86.Build.0 = Debug|Win32
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Release|x64.ActiveCfg = Release|x64
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Release|x64.Build.0 = Release|x64
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Release|x86.ActiveCfg = Release|Win32
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Release|x86.Build.0 = Release|Win32
{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}.Debug|x86.ActiveCfg = Debug|Win32
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Debug|x86.Build.0 = Debug|Win32
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Release|x64.ActiveCfg = Release|x64
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Release|x64.Build.0 = Release|x64
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Release|x86.ActiveCfg = Release|Win32
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Release|x86.Build.0 = Release|Win32
{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

View File

@@ -73,6 +73,7 @@
<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" />
@@ -91,6 +92,7 @@
<Import Project="..\GpMainApp.props" />
<Import Project="..\FreeTypePublic.props" />
<Import Project="..\FreeTypeImport.props" />
<Import Project="..\Release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
@@ -170,7 +172,7 @@
<ClInclude Include="..\GpCommon\GpDisplayDriverTickStatus.h" />
<ClInclude Include="..\GpCommon\GpFileCreationDisposition.h" />
<ClInclude Include="..\GpCommon\GpInputDriverProperties.h" />
<ClInclude Include="..\GpCommon\IGpColorCursor.h" />
<ClInclude Include="..\GpCommon\IGpCursor.h" />
<ClInclude Include="..\GpCommon\IGpAudioChannelCallbacks.h" />
<ClInclude Include="..\GpCommon\GpColorCursor_Win32.h" />
<ClInclude Include="..\GpCommon\IGpDisplayDriverSurface.h" />

View File

@@ -94,6 +94,11 @@ void GpAppEnvironment::Render()
GpAppInterface_Get()->PL_Render(m_displayDriver);
}
void GpAppEnvironment::AdjustRequestedResolution(unsigned int &width, unsigned int &height)
{
GpAppInterface_Get()->PL_AdjustRequestedResolution(width, height);
}
void GpAppEnvironment::SetDisplayDriver(IGpDisplayDriver *displayDriver)
{
m_displayDriver = displayDriver;

View File

@@ -28,6 +28,7 @@ public:
GpDisplayDriverTickStatus_t Tick(IGpFiber *vosFiber);
void Render();
void AdjustRequestedResolution(unsigned int &width, unsigned int &height);
void SetDisplayDriver(IGpDisplayDriver *displayDriver);
void SetAudioDriver(IGpAudioDriver *audioDriver);

View File

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

View File

@@ -27,6 +27,11 @@ namespace
{
static_cast<GpAppEnvironment*>(context)->Render();
}
void AdjustRequestedResolution(void *context, unsigned int &width, unsigned int &height)
{
static_cast<GpAppEnvironment*>(context)->AdjustRequestedResolution(width, height);
}
}
int GpMain::Run()
@@ -52,6 +57,9 @@ int GpMain::Run()
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;
@@ -63,7 +71,11 @@ int GpMain::Run()
// 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));

View File

@@ -1,6 +1,6 @@
#include "GpMain.h"
#include "GpAudioDriverFactory.h"
#include "GpColorCursor_Win32.h"
#include "GpCursor_Win32.h"
#include "GpDisplayDriverFactory.h"
#include "GpGlobalConfig.h"
#include "GpFiber_Win32.h"
@@ -341,7 +341,7 @@ static void TranslateWindowsMessage(const MSG *msg, IGpVOSEventQueue *eventQueue
GpKeyboardInputEvent::KeyUnion key;
bool isRepeat = ((lParam & 0x40000000) != 0);
const GpKeyboardInputEventType_t keyEventType = isRepeat ? GpKeyboardInputEventTypes::kAuto : GpKeyboardInputEventTypes::kDown;
if (!isRepeat && IdentifyVKey(wParam, lParam, subset, key))
if (IdentifyVKey(wParam, lParam, subset, key))
PostKeyboardEvent(eventQueue, keyEventType, subset, key, static_cast<uint32_t>(lParam & 0xffff));
(void)TranslateMessage(msg);
@@ -357,21 +357,20 @@ static void TranslateWindowsMessage(const MSG *msg, IGpVOSEventQueue *eventQueue
}
break;
case WM_CHAR:
{
bool isRepeat = ((lParam & 0x4000000) != 0);
const GpKeyboardInputEventType_t keyEventType = isRepeat ? GpKeyboardInputEventTypes::kAutoChar : GpKeyboardInputEventTypes::kDownChar;
GpKeyboardInputEvent::KeyUnion key;
key.m_asciiChar = static_cast<char>(wParam);
PostKeyboardEvent(eventQueue, keyEventType, GpKeyIDSubsets::kASCII, key, (lParam & 0xffff));
}
break;
case WM_UNICHAR:
{
bool isRepeat = ((lParam & 0x4000000) != 0);
const GpKeyboardInputEventType_t keyEventType = isRepeat ? GpKeyboardInputEventTypes::kAutoChar : GpKeyboardInputEventTypes::kDownChar;
GpKeyboardInputEvent::KeyUnion key;
key.m_unicodeChar = static_cast<uint32_t>(wParam);
PostKeyboardEvent(eventQueue, keyEventType, GpKeyIDSubsets::kUnicode, key, (lParam & 0xffff));
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;
default:
@@ -391,7 +390,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
g_gpWindowsGlobals.m_baseDir = GpFileSystem_Win32::GetInstance()->GetBasePath();
g_gpWindowsGlobals.m_createFiberFunc = GpFiber_Win32::Create;
g_gpWindowsGlobals.m_loadColorCursorFunc = GpColorCursor_Win32::Load;
g_gpWindowsGlobals.m_loadCursorFunc = GpCursor_Win32::Load;
g_gpWindowsGlobals.m_translateWindowsMessageFunc = TranslateWindowsMessage;
g_gpGlobalConfig.m_displayDriverType = EGpDisplayDriverType_D3D11;

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" :
[
]
}

View File

@@ -41,4 +41,6 @@ struct __GpStaticAssertHelper<true>
static const size_t GP_SYSTEM_MEMORY_ALIGNMENT = 16;
#if !defined(NDEBUG)
#define GP_DEBUG_CONFIG 1
#endif

View File

@@ -1,4 +1,5 @@
#include "CFileStream.h"
#include "BMPFormat.h"
#include "MMHandleBlock.h"
#include "ResourceCompiledTypeList.h"
#include "ResourceFile.h"
@@ -8,6 +9,7 @@
#include <assert.h>
#include <string>
#include <vector>
#include "stb_image_write.h"
@@ -53,6 +55,14 @@ struct CursorHeader
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;
@@ -84,6 +94,108 @@ 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');
@@ -196,7 +308,7 @@ void ConvertCursors(PortabilityLayer::ResourceFile *resFile)
}
char outPath[64];
sprintf_s(outPath, "Packaged\\WinCursors\\%i.cur", resID);
sprintf_s(outPath, "Packaged\\WinCursors\\c%i.cur", resID);
FILE *outF = nullptr;
errno_t outErr = fopen_s(&outF, outPath, "wb");
@@ -335,6 +447,7 @@ int main(int argc, const char **argv)
stream.Close();
ConvertCursors(resFile);
ConvertBWCursors(resFile);
ConvertIconFamily(resFile, 'ics#', 'ics8', "Small", 16);
ConvertIconFamily(resFile, 'ICN#', 'icl8', "Large", 32);

View File

@@ -4,7 +4,7 @@ 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"
x64\Release\gpr2gpa.exe "Packaged\ApplicationResources.gpr" "DefaultTimestamp.timestamp" "Packaged\ApplicationResources.gpa" "ApplicationResourcePatches\manifest.json"
x64\Release\ConvertColorCursors.exe
@@ -56,25 +56,27 @@ x64\Release\gpr2gpa.exe "Packaged\Houses\Teddy World.gpr" "DefaultTimestamp.time
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 "GliderProData\Houses\Art Museum.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Art Museum.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\Castle o' the Air.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Castle o' the Air.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\CD Demo House.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\CD Demo House.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\Davis Station.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Davis Station.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\Demo House.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Demo House.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\Grand Prix.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Grand Prix.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\ImagineHouse PRO II.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\ImagineHouse PRO II.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\Land of Illusion.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Land of Illusion.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\Leviathan.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Leviathan.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\Nemo's Market.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Nemo's Market.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\Rainbow's End.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Rainbow's End.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\Slumberland.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Slumberland.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\SpacePods.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\SpacePods.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\Teddy World.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Teddy World.mov" MooV ozm5 0 0 locked
x64\Release\FTagData.exe "GliderProData\Houses\Titanic.mov" "DefaultTimestamp.timestamp" "Packaged\Houses\Titanic.mov" MooV ozm5 0 0 locked
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

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

@@ -1,201 +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.
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.

View File

@@ -5,23 +5,22 @@
int main(int argc, const char **argv)
{
if (argc < 8)
if (argc < 7)
{
fprintf(stderr, "FTagData <input> <timestamp> <output> <file type ID> <file creator ID> <x pos> <y pos> [flags]");
fprintf(stderr, "FTagData <timestamp> <output.gpf> <file type ID> <file creator ID> <x pos> <y pos> [flags]");
return -1;
}
std::string inPath = argv[1];
std::string timestampPath = argv[2];
std::string outPath = argv[3];
std::string timestampPath = argv[1];
std::string outPath = argv[2];
if (strlen(argv[4]) != 4)
if (strlen(argv[3]) != 4)
{
fprintf(stderr, "File type ID must be 4 characters");
return -2;
}
if (strlen(argv[5]) != 4)
if (strlen(argv[4]) != 4)
{
fprintf(stderr, "File creator ID must be 4 characters");
return -3;
@@ -47,10 +46,10 @@ int main(int argc, const char **argv)
}
PortabilityLayer::MacFileProperties mfp;
memcpy(mfp.m_fileType, argv[4], 4);
memcpy(mfp.m_fileCreator, argv[5], 4);
mfp.m_xPos = atoi(argv[6]);
mfp.m_yPos = atoi(argv[7]);
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;
@@ -76,15 +75,11 @@ int main(int argc, const char **argv)
mfp.m_finderFlags |= PortabilityLayer::FINDER_FILE_FLAG_INITED;
}
std::string gpdPath = outPath + ".gpd";
CopyFile(inPath.c_str(), gpdPath.c_str(), 0);
PortabilityLayer::MacFilePropertiesSerialized mps;
mps.Serialize(mfp);
std::string gpfPath = outPath + ".gpf";
FILE *file = nullptr;
errno_t err = fopen_s(&file, gpfPath.c_str(), "wb");
errno_t err = fopen_s(&file, outPath.c_str(), "wb");
if (!err)
{
fwrite(mps.m_data, PortabilityLayer::MacFilePropertiesSerialized::kSize, 1, file);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -27,7 +27,7 @@
static void HiLiteOkayButton (DrawSurface *surface);
static void UnHiLiteOkayButton (DrawSurface *surface);
static void UpdateMainPict (Dialog *);
static int16_t AboutFilter(Dialog *, const TimeTaggedVOSEvent &evt);
static int16_t AboutFilter(Dialog *, const TimeTaggedVOSEvent *evt);
static Point okayButtLowerV, okayButtUpperV;
@@ -61,7 +61,7 @@ void DoAbout (void)
{
messagePtr = (**version).shortVersion + 1 + (**version).shortVersion[0];
BlockMove((Ptr)messagePtr, &longVersion, ((UInt8)*messagePtr) + 1);
memcpy(&longVersion, messagePtr, ((UInt8)*messagePtr) + 1);
SetDialogString(aboutDialog, kTextItemVers, longVersion);
}
@@ -149,10 +149,10 @@ static void UpdateMainPict (Dialog *theDial)
DrawDialogUserText2(theDial, 7, theStr);
PasStringCopy(PSTR("Screen: "), theStr); // display screen size/depth
NumToString((long)(thisMac.screen.right - thisMac.screen.left), theStr2);
NumToString((long)(thisMac.fullScreen.right - thisMac.fullScreen.left), theStr2);
PasStringConcat(theStr, theStr2);
PasStringConcat(theStr, PSTR("x"));
NumToString((long)(thisMac.screen.bottom - thisMac.screen.top), theStr2);
NumToString((long)(thisMac.fullScreen.bottom - thisMac.fullScreen.top), theStr2);
PasStringConcat(theStr, theStr2);
PasStringConcat(theStr, PSTR("x"));
NumToString((long)thisMac.isDepth, theStr2);
@@ -176,17 +176,20 @@ static bool PointIsInDiagonalOkayButton(const Point &pt)
//-------------------------------------------------------------- AboutFilter
// Dialog filter for the About dialog.
static int16_t AboutFilter(Dialog *dialog, const TimeTaggedVOSEvent &evt)
static int16_t AboutFilter(Dialog *dialog, const TimeTaggedVOSEvent *evt)
{
bool handledIt = false;
int16_t hit = -1;
if (!evt)
return -1;
Window *window = dialog->GetWindow();
DrawSurface *surface = window->GetDrawSurface();
if (evt.IsKeyDownEvent())
if (evt->IsKeyDownEvent())
{
switch (PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent))
switch (PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent))
{
case PL_KEY_SPECIAL(kEnter):
case PL_KEY_NUMPAD_SPECIAL(kEnter):
@@ -202,9 +205,9 @@ static int16_t AboutFilter(Dialog *dialog, const TimeTaggedVOSEvent &evt)
break;
}
}
else if (evt.m_vosEvent.m_eventType == GpVOSEventTypes::kMouseInput)
else if (evt->m_vosEvent.m_eventType == GpVOSEventTypes::kMouseInput)
{
const GpMouseInputEvent &mouseEvt = evt.m_vosEvent.m_event.m_mouseInputEvent;
const GpMouseInputEvent &mouseEvt = evt->m_vosEvent.m_event.m_mouseInputEvent;
const Point mousePt = window->MouseToLocal(mouseEvt);
if (mouseEvt.m_eventType == GpMouseEventTypes::kDown)

View File

@@ -11,7 +11,7 @@
#include "Externs.h"
#include "Environ.h"
#include "HostDisplayDriver.h"
#include "IGpColorCursor.h"
#include "IGpCursor.h"
#include "IGpDisplayDriver.h"
#include "ResourceManager.h"
@@ -37,7 +37,7 @@ typedef struct
{
struct
{
IGpColorCursor *hwCursor;
IGpCursor *hwCursor;
} frame[1];
} compiledAcurRec;
@@ -61,7 +61,7 @@ compiledAcurHandle compiledAnimCursorH = nil;
Boolean GetColorCursors (acurHandle ballCursH, compiledAcurHandle compiledBallCursH)
{
short i, j;
IGpColorCursor *hwCursor;
IGpCursor *hwCursor;
Boolean result = true;
if (ballCursH)
@@ -70,7 +70,7 @@ Boolean GetColorCursors (acurHandle ballCursH, compiledAcurHandle compiledBallCu
HideCursor(); // Hide the cursor
for (i = 0; i < j; i++) // Walk through the acur resource
{
hwCursor = PortabilityLayer::HostDisplayDriver::GetInstance()->LoadColorCursor((*ballCursH)->frame[i].resID); // Get the cursor
hwCursor = PortabilityLayer::HostDisplayDriver::GetInstance()->LoadCursor(true, (*ballCursH)->frame[i].resID); // Get the cursor
if (hwCursor == nil) // Make sure a real cursor was returned
{ // If not, trash all cursors loaded
for (j = 0; j < i; j++)
@@ -81,7 +81,7 @@ Boolean GetColorCursors (acurHandle ballCursH, compiledAcurHandle compiledBallCu
else // But, if the cursor loaded ok
{ // add it to our list or cursor handles
(*compiledBallCursH)->frame[i].hwCursor = hwCursor;
PortabilityLayer::HostDisplayDriver::GetInstance()->SetColorCursor(hwCursor);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetCursor(hwCursor);
}
}
InitCursor(); // Show the cursor again (as arrow)
@@ -168,10 +168,10 @@ void IncrementCursor (void)
(*animCursorH)->index++;
(*animCursorH)->index %= (*animCursorH)->n;
PortabilityLayer::HostDisplayDriver::GetInstance()->SetColorCursor((*compiledAnimCursorH)->frame[(*animCursorH)->index].hwCursor);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetCursor((*compiledAnimCursorH)->frame[(*animCursorH)->index].hwCursor);
}
else
SetBuiltinCursor(watchCursor);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetStandardCursor(EGpStandardCursors::kWait);
}
//-------------------------------------------------------------- DecrementCursor
@@ -188,10 +188,10 @@ void DecrementCursor (void)
if (((*animCursorH)->index) < 0)
(*animCursorH)->index = ((*animCursorH)->n) - 1;
PortabilityLayer::HostDisplayDriver::GetInstance()->SetColorCursor((*compiledAnimCursorH)->frame[(*animCursorH)->index].hwCursor);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetCursor((*compiledAnimCursorH)->frame[(*animCursorH)->index].hwCursor);
}
else
SetBuiltinCursor(watchCursor);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetStandardCursor(EGpStandardCursors::kWait);
}
//-------------------------------------------------------------- SpinCursor

View File

@@ -56,6 +56,7 @@ PLError_t DoOpenDocAE (const AppleEvent *theAE, AppleEvent *reply, UInt32 ref)
DescType returnedType;
PLError_t theErr, whoCares;
short i;
bool redrawMainWindow = false;
theErr = AEGetParamDesc(theAE, keyDirectObject, typeAEList, &docList);
if (theErr != PLErrors::kNone)
@@ -112,7 +113,7 @@ PLError_t DoOpenDocAE (const AppleEvent *theAE, AppleEvent *reply, UInt32 ref)
Rect updateRect;
SetRect(&updateRect, splashOriginH + 474, splashOriginV + 304, splashOriginH + 474 + 166, splashOriginV + 304 + 12);
InvalWindowRect(mainWindow, &updateRect);
redrawMainWindow = true;
}
}
}
@@ -120,6 +121,9 @@ PLError_t DoOpenDocAE (const AppleEvent *theAE, AppleEvent *reply, UInt32 ref)
}
#endif
whoCares = AEDisposeDesc(&docList);
if (redrawMainWindow)
UpdateMainWindow();
return theErr;
}

View File

@@ -50,7 +50,7 @@ void DrawBanner (Point *topLeft)
PLError_t theErr;
QSetRect(&wholePage, 0, 0, 330, 220);
mapBounds = thisMac.screen;
mapBounds = thisMac.fullScreen;
ZeroRectCorner(&mapBounds);
CenterRectInRect(&wholePage, &mapBounds);
topLeft->h = wholePage.left;
@@ -203,8 +203,8 @@ void DisplayStarsRemaining (void)
DrawSurface *surface = mainWindow->GetDrawSurface();
QSetRect(&bounds, 0, 0, 256, 64);
CenterRectInRect(&bounds, &thisMac.screen);
QOffsetRect(&bounds, -thisMac.screen.left, -thisMac.screen.top);
CenterRectInRect(&bounds, &thisMac.fullScreen);
QOffsetRect(&bounds, -thisMac.fullScreen.left, -thisMac.fullScreen.top);
src = bounds;
InsetRect(&src, 64, 32);

View File

@@ -59,18 +59,28 @@ void ColorOval (DrawSurface *surface, const Rect &theRect, long color)
surface->SetForeColor(wasColor);
}
//-------------------------------------------------------------- ColorRegion
void ColorOvalMaskPattern(DrawSurface *surface, const Rect &theRect, long color, bool isMask, const uint8_t *pattern)
{
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[color];
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
surface->SetForeColor(rgbaColor);
surface->FillEllipseWithPattern(theRect, isMask, pattern);
surface->SetForeColor(wasColor);
}
//-------------------------------------------------------------- ColorRegionMaskPattern
// Given a region and color index, this function draws a solidÉ
// region in that color. Current port, pen mode, etc. assumed.
void ColorRegion (DrawSurface *surface, PortabilityLayer::ScanlineMask *scanlineMask, long colorIndex)
void ColorRegionMaskPattern (DrawSurface *surface, PortabilityLayer::ScanlineMask *scanlineMask, long colorIndex, bool isMask, const uint8_t *pattern)
{
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[colorIndex];
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
surface->SetForeColor(rgbaColor);
surface->FillScanlineMask(scanlineMask);
surface->FillScanlineMaskWithPattern(scanlineMask, isMask, pattern);
surface->SetForeColor(wasColor);
}

View File

@@ -124,18 +124,19 @@ void OpenCoordWindow (void)
Rect src, dest;
Point globalMouse;
short direction, dist;
PortabilityLayer::WindowManager *wm = PortabilityLayer::WindowManager::GetInstance();
if (coordWindow == nil)
{
const uint16_t windowStyle = PortabilityLayer::WindowStyleFlags::kTitleBar | PortabilityLayer::WindowStyleFlags::kMiniBar;
const uint16_t windowStyle = PortabilityLayer::WindowStyleFlags::kTitleBar | PortabilityLayer::WindowStyleFlags::kMiniBar | PortabilityLayer::WindowStyleFlags::kCloseBox;
QSetRect(&coordWindowRect, 0, 0, 50, 38);
if (thisMac.hasColor)
coordWindow = NewCWindow(nil, &coordWindowRect,
PSTR("Tools"), false, windowStyle, kPutInFront, true, 0L);
else
coordWindow = NewWindow(nil, &coordWindowRect,
PSTR("Tools"), false, windowStyle, kPutInFront, true, 0L);
{
PortabilityLayer::WindowDef wdef = PortabilityLayer::WindowDef::Create(coordWindowRect, windowStyle, true, 0, 0, PSTR("Tools"));
coordWindow = wm->CreateWindow(wdef);
}
if (coordWindow == nil)
RedAlert(kErrNoMemory);
@@ -148,10 +149,9 @@ void OpenCoordWindow (void)
MoveWindow(coordWindow, isCoordH, isCoordV, true);
GetWindowRect(coordWindow, &dest);
BringToFront(coordWindow);
wm->PutWindowBehind(coordWindow, wm->GetPutInFrontSentinel());
PortabilityLayer::WindowManager::GetInstance()->ShowWindow(coordWindow);
// FlagWindowFloating(coordWindow); TEMP - use flaoting windows
HiliteAllWindows();
coordH = -1;
coordV = -1;

View File

@@ -374,8 +374,6 @@ void DrawDefaultButton (Dialog *theDialog)
surface->FrameRoundRect(offsetRect, 8, 8);
}
}
PenNormal();
}
//-------------------------------------------------------------- GetDialogString
@@ -397,7 +395,9 @@ void GetDialogString (Dialog *theDialog, short item, StringPtr theString)
void SetDialogString (Dialog *theDialog, short item, const PLPasStr &theString)
{
theDialog->GetItems()[item - 1].GetWidget()->SetString(theString);
PortabilityLayer::Widget *widget = theDialog->GetItems()[item - 1].GetWidget();
widget->SetString(theString);
widget->DrawControl(theDialog->GetWindow()->GetDrawSurface());
}
//-------------------------------------------------------------- GetDialogStringLen
@@ -433,18 +433,17 @@ void SetDialogItemValue (Dialog *theDialog, short item, short theState)
void ToggleDialogItemValue (Dialog *theDialog, short item)
{
Rect itemRect;
ControlHandle itemHandle;
int16_t itemType, theState;
const PortabilityLayer::DialogItem &itemRef = theDialog->GetItems()[item - 1];
int16_t theState;
theState = itemRef.GetWidget()->GetState();
PortabilityLayer::Widget *widget = theDialog->GetItems()[item - 1].GetWidget();
theState = widget->GetState();
if (theState == 0)
theState = 1;
else
theState = 0;
SetControlValue(itemHandle, theState);
widget->SetState(theState);
widget->DrawControl(theDialog->GetWindow()->GetDrawSurface());
}
//-------------------------------------------------------------- SetDialogNumToStr
@@ -601,7 +600,6 @@ void DrawDialogUserText (Dialog *dial, short item, StringPtr text, Boolean inver
iRect.right -= inset;
// Draw centered
PL_NotYetImplemented_TODO("Clip to iRect");
const int32_t ascender = surface->MeasureFontAscender();
@@ -708,7 +706,7 @@ void FrameOvalDialogItem (Dialog *theDialog, short item)
// Given a dialog item, this function draws any combination of 4 sidesÉ
// of a box around it. Which sides get drawn is encoded in "sides".
void BorderDialogItem (Dialog *theDialog, short item, short sides)
void BorderDialogItem(Dialog *theDialog, short item, short sides, short thickness, const uint8_t *pattern)
{
// 1 = left
// 2 = top
@@ -724,29 +722,65 @@ void BorderDialogItem (Dialog *theDialog, short item, short sides)
if (sides >= 8) // 8 = right
{
const Point pointA = Point::Create(itemRect.right, itemRect.top);
const Point pointB = Point::Create(itemRect.right, itemRect.bottom);
surface->DrawLine(pointA, pointB);
const Point pointB = Point::Create(itemRect.right + thickness, itemRect.bottom + 1);
const Rect rect = Rect::Create(pointA.v, pointA.h, pointB.v, pointB.h);
if (pattern)
{
surface->SetForeColor(StdColors::White());
surface->FillRect(rect);
surface->SetForeColor(StdColors::Black());
surface->FillRectWithPattern8x8(rect, true, pattern);
}
else
surface->FillRect(rect);
sides -= 8;
}
if (sides >= 4) // 4 = bottom
{
const Point pointA = Point::Create(itemRect.left, itemRect.bottom);
const Point pointB = Point::Create(itemRect.right, itemRect.bottom);
surface->DrawLine(pointA, pointB);
const Point pointB = Point::Create(itemRect.right + 1, itemRect.bottom + thickness);
const Rect rect = Rect::Create(pointA.v, pointA.h, pointB.v, pointB.h);
if (pattern)
{
surface->SetForeColor(StdColors::White());
surface->FillRect(rect);
surface->SetForeColor(StdColors::Black());
surface->FillRectWithPattern8x8(rect, true, pattern);
}
else
surface->FillRect(rect);
sides -= 4;
}
if (sides >= 2) // 2 = top
{
const Point pointA = Point::Create(itemRect.left, itemRect.top - 1);
const Point pointB = Point::Create(itemRect.right, itemRect.top - 1);
surface->DrawLine(pointA, pointB);
const Point pointB = Point::Create(itemRect.right + 1, itemRect.top + thickness);
const Rect rect = Rect::Create(pointA.v, pointA.h, pointB.v, pointB.h);
if (pattern)
{
surface->SetForeColor(StdColors::White());
surface->FillRect(rect);
surface->SetForeColor(StdColors::Black());
surface->FillRectWithPattern8x8(rect, true, pattern);
}
else
surface->FillRect(rect);
sides -= 2;
}
if (sides >= 1) // 1 = left
{
const Point pointA = Point::Create(itemRect.left - 1, itemRect.top);
const Point pointB = Point::Create(itemRect.left - 1, itemRect.bottom);
surface->DrawLine(pointA, pointB);
const Point pointB = Point::Create(itemRect.left - 1 + thickness, itemRect.bottom + 1);
const Rect rect = Rect::Create(pointA.v, pointA.h, pointB.v, pointB.h);
if (pattern)
{
surface->SetForeColor(StdColors::White());
surface->FillRect(rect);
surface->SetForeColor(StdColors::Black());
surface->FillRectWithPattern8x8(rect, true, pattern);
}
else
surface->FillRect(rect);
}
}

View File

@@ -43,6 +43,6 @@ void LoadDialogPICT (Dialog *, short, short);
void FrameDialogItem (Dialog *, short);
void FrameDialogItemC (Dialog *, short, long);
void FrameOvalDialogItem (Dialog *, short);
void BorderDialogItem (Dialog *, short, short);
void BorderDialogItem (Dialog *theDialog, short item, short sides, short thickness, const uint8_t *pattern);
void ShadowDialogItem (Dialog *, short, short);
void EraseDialogItem (Dialog *, short);

View File

@@ -5,10 +5,12 @@
//============================================================================
#include "ArrayTools.h"
#include "Externs.h"
#include "Environ.h"
#include "MainWindow.h"
#include "Objects.h"
#include "QDPixMap.h"
#include "RectUtils.h"
#include "Room.h"
#include "Utilities.h"
@@ -67,7 +69,7 @@ void NilSavedMaps (void)
// room that it obscured so that, should the player get the object,É
// it can be made to "disappear".
short BackUpToSavedMap (Rect *theRect, short where, short who)
short BackUpToSavedMap (Rect *theRect, SInt16 where, SInt16 who)
{
Rect mapRect;
PLError_t theErr;
@@ -97,7 +99,7 @@ short BackUpToSavedMap (Rect *theRect, short where, short who)
// a slot in the pixmap array for the object. It re-copies the backgroundÉ
// and is needed when the lights in the room go on or off.
short ReBackUpSavedMap (Rect *theRect, short where, short who)
SInt16 ReBackUpSavedMap (Rect *theRect, SInt16 where, SInt16 who)
{
Rect mapRect;
short i, foundIndex;
@@ -111,6 +113,8 @@ short ReBackUpSavedMap (Rect *theRect, short where, short who)
foundIndex = i;
mapRect = *theRect;
ZeroRectCorner(&mapRect);
savedMaps[foundIndex].dest = *theRect;
CopyBits((BitMap *)*GetGWorldPixMap(backSrcMap),
GetPortBitMapForCopyBits(savedMaps[foundIndex].map),
@@ -120,7 +124,54 @@ short ReBackUpSavedMap (Rect *theRect, short where, short who)
}
}
return (foundIndex);
return BackUpToSavedMap(theRect, where, who);
}
//-------------------------------------------------------------- RemoveFromSavedMap
template<class T>
void RemapDynamicObject(T *arr, short &count, int removedIndex, int substituteIndex)
{
short countCopy = count;
for (int i = 0; i < countCopy; i++)
{
if (arr[i].who == removedIndex)
{
PortabilityLayer::ArrayTools::RemoveFromArray(arr, countCopy, i);
i--;
}
else if (arr[i].who == substituteIndex)
arr[i].who = removedIndex;
}
count = countCopy;
}
SInt16 RemoveFromSavedMap (SInt16 index)
{
int swappedIn = numSavedMaps - 1;
RemapDynamicObject(flames, numFlames, index, swappedIn);
RemapDynamicObject(tikiFlames, numTikiFlames, index, swappedIn);
RemapDynamicObject(bbqCoals, numCoals, index, swappedIn);
RemapDynamicObject(pendulums, numPendulums, index, swappedIn);
RemapDynamicObject(theStars, numStars, index, swappedIn);
RemapGreaseSavedMap(index, swappedIn);
// Have to do this explicitly so we don't trash the draw surface pointer
if (swappedIn != index)
{
savedType &dest = savedMaps[index];
savedType &src = savedMaps[swappedIn];
DisposeGWorld(dest.map);
dest = src;
src.map = nil;
}
numSavedMaps--;
return -1;
}
//-------------------------------------------------------------- RestoreFromSavedMap
@@ -289,7 +340,7 @@ void BackUpFlames (Rect *src, short index)
// Like the above function but this is called when the lighting changesÉ
// in a room (lights go on or off).
void ReBackUpFlames (short where, short who)
Boolean ReBackUpFlames (short where, short who, short h, short v)
{
short i, f;
@@ -301,19 +352,22 @@ void ReBackUpFlames (short where, short who)
{
if (flames[f].who == i)
{
QOffsetRect(&flames[f].dest, h - 8 - flames[f].dest.left, v - 15 - flames[f].dest.top);
BackUpFlames(&flames[f].dest, i);
return;
return true;
}
}
}
}
return false;
}
//-------------------------------------------------------------- AddCandleFlame
// This adds a candle flame to tha array of flames.
void AddCandleFlame (short where, short who, short h, short v)
void AddCandleFlame (SInt16 where, SInt16 who, SInt16 h, SInt16 v)
{
Rect src, bounds;
short savedNum;
@@ -373,7 +427,7 @@ void BackUpTikiFlames (Rect *src, short index)
// This is like the function ReBackUpFlames() but customized for Tiki torches.
void ReBackUpTikiFlames (short where, short who)
Boolean ReBackUpTikiFlames (short where, short who, short h, short v)
{
short i, f;
@@ -385,12 +439,15 @@ void ReBackUpTikiFlames (short where, short who)
{
if (tikiFlames[f].who == i)
{
QOffsetRect(&tikiFlames[f].dest, h - tikiFlames[f].dest.left, v - tikiFlames[f].dest.top);
BackUpTikiFlames(&tikiFlames[f].dest, i);
return;
return true;
}
}
}
}
return false;
}
//-------------------------------------------------------------- AddTikiFlame
@@ -459,7 +516,7 @@ void BackUpBBQCoals (Rect *src, short index)
// Sense a pattern here?
void ReBackUpBBQCoals (short where, short who)
Boolean ReBackUpBBQCoals (short where, short who, short h, short v)
{
short i, f;
@@ -471,12 +528,15 @@ void ReBackUpBBQCoals (short where, short who)
{
if (bbqCoals[f].who == i)
{
QOffsetRect(&bbqCoals[f].dest, h - bbqCoals[f].dest.left, v - bbqCoals[f].dest.top);
BackUpBBQCoals(&bbqCoals[f].dest, i);
return;
return true;
}
}
}
}
return false;
}
//-------------------------------------------------------------- AddBBQCoals
@@ -543,7 +603,7 @@ void BackUpPendulum (Rect *src, short index)
// Backs up the pendulums in the event of lights going on or off.
void ReBackUpPendulum (short where, short who)
Boolean ReBackUpPendulum (short where, short who, short h, short v)
{
short i, f;
@@ -555,19 +615,26 @@ void ReBackUpPendulum (short where, short who)
{
if (pendulums[f].who == i)
{
BackUpPendulum(&pendulums[f].dest, i);
return;
Rect &pendulumDest = pendulums[f].dest;
pendulumDest.right += h - pendulumDest.left;
pendulumDest.bottom += v - pendulumDest.top;
pendulumDest.left = h;
pendulumDest.top = v;
BackUpPendulum(&pendulumDest, i);
return true;
}
}
}
}
return false;
}
//-------------------------------------------------------------- AddPendulum
// Adds a pendulum to the array of pendulums.
void AddPendulum (short where, short who, short h, short v)
void AddPendulum (SInt16 where, SInt16 who, SInt16 h, SInt16 v)
{
Rect src, bounds;
short savedNum;
@@ -635,7 +702,7 @@ void BackUpStar (Rect *src, short index)
// Re-backs up the stars - in the event of lighting switch.
void ReBackUpStar (short where, short who)
void ReBackUpStar (short where, short who, short h, short v)
{
short i, f;
@@ -647,6 +714,7 @@ void ReBackUpStar (short where, short who)
{
if (theStars[f].who == i)
{
QOffsetRect(&theStars[f].dest, h - theStars[f].dest.left, v - theStars[f].dest.top);
BackUpStar(&theStars[f].dest, i);
return;
}
@@ -796,3 +864,14 @@ void ZeroFlamesAndTheLike (void)
numChimes = 0;
}
void RemoveSavedMapsNotInRoom(SInt16 where)
{
for (int i = 0; i < numSavedMaps; i++)
{
if (savedMaps[i].where != where)
{
RemoveFromSavedMap(i);
i--;
}
}
}

View File

@@ -153,6 +153,48 @@ void RenderDynamics (void)
}
}
//-------------------------------------------------------------- ZeroDinah
void ZeroDinah(dynaType &dinah)
{
dinah.type = kObjectIsEmpty;
QSetRect(&dinah.dest, 0, 0, 0, 0);
QSetRect(&dinah.whole, 0, 0, 0, 0);
dinah.hVel = 0;
dinah.vVel = 0;
dinah.count = 0;
dinah.frame = 0;
dinah.timer = 0;
dinah.position = 0;
dinah.room = 0;
dinah.byte0 = 0;
dinah.active = false;
}
//-------------------------------------------------------------- ZeroDinahsNotInRoom
void ZeroDinahsNotInRoom (SInt16 room)
{
short i;
short newNumDynamics = 0;
for (i = 0; i < numDynamics; i++)
{
dynaType &dinah = dinahs[i];
if (dinah.room == room)
{
if (newNumDynamics != numDynamics)
memcpy(&dinahs[newNumDynamics], &dinahs[i], sizeof(dynaType));
newNumDynamics++;
}
}
for (i = newNumDynamics; i < kMaxDynamicObs; i++)
ZeroDinah(dinahs[i]);
numDynamics = newNumDynamics;
}
//-------------------------------------------------------------- ZeroDinahs
// This clears all dynamics - zeros them all out. Used to initialize them.
@@ -162,20 +204,8 @@ void ZeroDinahs (void)
short i;
for (i = 0; i < kMaxDynamicObs; i++)
{
dinahs[i].type = kObjectIsEmpty;
QSetRect(&dinahs[i].dest, 0, 0, 0, 0);
QSetRect(&dinahs[i].whole, 0, 0, 0, 0);
dinahs[i].hVel = 0;
dinahs[i].vVel = 0;
dinahs[i].count = 0;
dinahs[i].frame = 0;
dinahs[i].timer = 0;
dinahs[i].position = 0;
dinahs[i].room = 0;
dinahs[i].byte0 = 0;
dinahs[i].active = false;
}
ZeroDinah(dinahs[i]);
numDynamics = 0;
}
@@ -185,371 +215,494 @@ void ZeroDinahs (void)
// This function sets up the structures to handle them.
short AddDynamicObject (short what, Rect *where, objectType *who,
short room, short index, Boolean isOn)
short room, short index, Boolean isOn, Boolean keepExisting)
{
short position, velocity;
Boolean lilFrame;
if (numDynamics >= kMaxDynamicObs)
return (-1);
dinahs[numDynamics].type = what;
switch (what)
short dynIndex = -1;
if (!keepExisting)
{
case kSparkle:
dinahs[numDynamics].dest = sparkleSrc[0];
ZeroRectCorner(&dinahs[numDynamics].dest);
QOffsetRect(&dinahs[numDynamics].dest, where->left, where->top);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = 0;
dinahs[numDynamics].vVel = 0;
dinahs[numDynamics].count = 0;
dinahs[numDynamics].frame = 0;
dinahs[numDynamics].timer = RandomInt(60) + 15;
dinahs[numDynamics].position = 0;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn;
break;
case kToaster:
dinahs[numDynamics].dest = breadSrc[0];
CenterRectInRect(&dinahs[numDynamics].dest, where);
VOffsetRect(&dinahs[numDynamics].dest,
where->top - dinahs[numDynamics].dest.top);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = where->top + 2; // hVel used as clip
position = who->data.g.height; // reverse engineer init. vel.
velocity = 0;
do
if (numDynamics >= kMaxDynamicObs)
return (-1);
dynIndex = numDynamics;
numDynamics++;
dinahs[dynIndex].type = what;
}
else
{
for (int i = 0; i < numDynamics; i++)
{
velocity++;
position -= velocity;
if (dinahs[i].type == what && dinahs[i].room == room && dinahs[i].byte0 == index)
{
dynIndex = i;
break;
}
}
while (position > 0);
dinahs[numDynamics].vVel = -velocity;
dinahs[numDynamics].count = velocity; // count = initial velocity
dinahs[numDynamics].frame = (short)who->data.g.delay * 3;
dinahs[numDynamics].timer = dinahs[numDynamics].frame;
dinahs[numDynamics].position = 0; // launch/idle state
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn;
break;
case kMacPlus:
dinahs[numDynamics].dest = plusScreen1;
ZeroRectCorner(&dinahs[numDynamics].dest);
QOffsetRect(&dinahs[numDynamics].dest,
where->left + playOriginH + 10,
where->top + playOriginV + 7);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = 0;
dinahs[numDynamics].vVel = 0;
dinahs[numDynamics].count = 0;
dinahs[numDynamics].frame = 0;
dinahs[numDynamics].timer = 0;
dinahs[numDynamics].position = 0;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn;
break;
case kTV:
dinahs[numDynamics].dest = tvScreen1;
ZeroRectCorner(&dinahs[numDynamics].dest);
QOffsetRect(&dinahs[numDynamics].dest,
where->left + playOriginH + 17,
where->top + playOriginV + 10);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = 0;
dinahs[numDynamics].vVel = 0;
dinahs[numDynamics].count = 0;
dinahs[numDynamics].frame = 0;
dinahs[numDynamics].timer = 0;
dinahs[numDynamics].position = 0;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn;
break;
case kCoffee:
dinahs[numDynamics].dest = coffeeLight1;
ZeroRectCorner(&dinahs[numDynamics].dest);
QOffsetRect(&dinahs[numDynamics].dest,
where->left + playOriginH + 32,
where->top + playOriginV + 57);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = 0;
dinahs[numDynamics].vVel = 0;
dinahs[numDynamics].count = 0;
dinahs[numDynamics].frame = 0;
if (isOn)
dinahs[numDynamics].timer = 200;
else
dinahs[numDynamics].timer = 0;
dinahs[numDynamics].position = 0;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn;
break;
case kOutlet:
dinahs[numDynamics].dest = outletSrc[0];
ZeroRectCorner(&dinahs[numDynamics].dest);
QOffsetRect(&dinahs[numDynamics].dest,
where->left + playOriginH,
where->top + playOriginV);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = numLights;
dinahs[numDynamics].vVel = 0;
dinahs[numDynamics].count = ((short)who->data.g.delay * 6) / kTicksPerFrame;
dinahs[numDynamics].frame = 0;
dinahs[numDynamics].timer = dinahs[numDynamics].count;
dinahs[numDynamics].position = 0; // launch/idle state
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn;
break;
case kVCR:
dinahs[numDynamics].dest = vcrTime1;
ZeroRectCorner(&dinahs[numDynamics].dest);
QOffsetRect(&dinahs[numDynamics].dest,
where->left + playOriginH + 64,
where->top + playOriginV + 6);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = 0;
dinahs[numDynamics].vVel = 0;
dinahs[numDynamics].count = 0;
dinahs[numDynamics].frame = 0;
if (isOn)
dinahs[numDynamics].timer = 115;
else
dinahs[numDynamics].timer = 0;
dinahs[numDynamics].position = 0;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn;
break;
case kStereo:
dinahs[numDynamics].dest = stereoLight1;
ZeroRectCorner(&dinahs[numDynamics].dest);
QOffsetRect(&dinahs[numDynamics].dest,
where->left + playOriginH + 56,
where->top + playOriginV + 20);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = 0;
dinahs[numDynamics].vVel = 0;
dinahs[numDynamics].count = 0;
dinahs[numDynamics].frame = 0;
dinahs[numDynamics].timer = 0;
dinahs[numDynamics].position = 0;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn;
break;
case kMicrowave:
dinahs[numDynamics].dest = microOn;
ZeroRectCorner(&dinahs[numDynamics].dest);
QOffsetRect(&dinahs[numDynamics].dest,
where->left + playOriginH + 14,
where->top + playOriginV + 13);
dinahs[numDynamics].dest.right = dinahs[numDynamics].dest.left + 48;
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = 0;
dinahs[numDynamics].vVel = 0;
dinahs[numDynamics].count = 0;
dinahs[numDynamics].frame = 0;
dinahs[numDynamics].timer = 0;
dinahs[numDynamics].position = 0;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn;
break;
case kBalloon:
dinahs[numDynamics].dest = balloonSrc[0];
ZeroRectCorner(&dinahs[numDynamics].dest);
QOffsetRect(&dinahs[numDynamics].dest, where->left, 0);
dinahs[numDynamics].dest.bottom = kBalloonStart;
dinahs[numDynamics].dest.top = dinahs[numDynamics].dest.bottom -
RectTall(&balloonSrc[0]);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = 0;
dinahs[numDynamics].vVel = -2;
dinahs[numDynamics].count = ((short)who->data.h.delay * 6) / kTicksPerFrame;
dinahs[numDynamics].frame = 0;
dinahs[numDynamics].timer = dinahs[numDynamics].count;
dinahs[numDynamics].position = 0;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn; // initially idle
break;
case kCopterLf:
case kCopterRt:
dinahs[numDynamics].dest = copterSrc[0];
ZeroRectCorner(&dinahs[numDynamics].dest);
QOffsetRect(&dinahs[numDynamics].dest, where->left, 0);
dinahs[numDynamics].dest.top = kCopterStart;
dinahs[numDynamics].dest.bottom = dinahs[numDynamics].dest.top +
RectTall(&copterSrc[0]);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
if (what == kCopterLf)
dinahs[numDynamics].hVel = -1;
else
dinahs[numDynamics].hVel = 1;
dinahs[numDynamics].vVel = 2;
dinahs[numDynamics].count = ((short)who->data.h.delay * 6) / kTicksPerFrame;
dinahs[numDynamics].frame = 0;
dinahs[numDynamics].timer = dinahs[numDynamics].count;
dinahs[numDynamics].position = dinahs[numDynamics].dest.left;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn; // initially idle
break;
case kDartLf:
case kDartRt:
dinahs[numDynamics].dest = dartSrc[0];
ZeroRectCorner(&dinahs[numDynamics].dest);
if (what == kDartLf)
{
QOffsetRect(&dinahs[numDynamics].dest,
kRoomWide - RectWide(&dartSrc[0]), where->top);
dinahs[numDynamics].hVel = -kDartVelocity;
dinahs[numDynamics].frame = 0;
}
else
{
QOffsetRect(&dinahs[numDynamics].dest, 0, where->top);
dinahs[numDynamics].hVel = kDartVelocity;
dinahs[numDynamics].frame = 2;
}
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].vVel = 2;
dinahs[numDynamics].count = ((short)who->data.h.delay * 6) / kTicksPerFrame;
dinahs[numDynamics].timer = dinahs[numDynamics].count;
dinahs[numDynamics].position = dinahs[numDynamics].dest.top;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn; // initially idle
break;
case kBall:
dinahs[numDynamics].dest = ballSrc[0];
ZeroRectCorner(&dinahs[numDynamics].dest);
QOffsetRect(&dinahs[numDynamics].dest,
where->left, where->top);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = 0;
position = who->data.h.length; // reverse engineer init. vel.
velocity = 0;
evenFrame = true;
lilFrame = true;
do
{
if (lilFrame)
velocity++;
lilFrame = !lilFrame;
position -= velocity;
}
while (position > 0);
dinahs[numDynamics].vVel = -velocity;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].count = -velocity; // count = initial velocity
dinahs[numDynamics].frame = 0;
dinahs[numDynamics].timer = 0;
dinahs[numDynamics].position = dinahs[numDynamics].dest.bottom;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].active = isOn;
break;
case kDrip:
dinahs[numDynamics].dest = dripSrc[0];
CenterRectInRect(&dinahs[numDynamics].dest, where);
VOffsetRect(&dinahs[numDynamics].dest,
where->top - dinahs[numDynamics].dest.top);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = dinahs[numDynamics].dest.top; // remember
dinahs[numDynamics].vVel = 0;
dinahs[numDynamics].count = ((short)who->data.h.delay * 6) / kTicksPerFrame;
dinahs[numDynamics].frame = 3;
dinahs[numDynamics].timer = dinahs[numDynamics].count;
dinahs[numDynamics].position = dinahs[numDynamics].dest.top +
who->data.h.length;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn;
break;
case kFish:
dinahs[numDynamics].dest = fishSrc[0];
QOffsetRect(&dinahs[numDynamics].dest,
where->left + 10, where->top + 8);
dinahs[numDynamics].whole = dinahs[numDynamics].dest;
dinahs[numDynamics].hVel = ((short)who->data.h.delay * 6) / kTicksPerFrame;
position = who->data.g.height; // reverse engineer init. vel.
velocity = 0;
evenFrame = true;
lilFrame = true;
do
{
if (lilFrame)
velocity++;
lilFrame = !lilFrame;
position -= velocity;
}
while (position > 0);
dinahs[numDynamics].vVel = -velocity;
dinahs[numDynamics].count = -velocity; // count = initial velocity
dinahs[numDynamics].frame = 0;
dinahs[numDynamics].timer = dinahs[numDynamics].hVel;
dinahs[numDynamics].position = dinahs[numDynamics].dest.bottom;
dinahs[numDynamics].room = room;
dinahs[numDynamics].byte0 = (Byte)index;
dinahs[numDynamics].byte1 = 0;
dinahs[numDynamics].moving = false;
dinahs[numDynamics].active = isOn;
break;
default:
return (-1);
break;
if (dynIndex == -1)
return (-1);
}
numDynamics++;
return (numDynamics - 1);
}
switch (what)
{
case kSparkle:
dinahs[dynIndex].dest = sparkleSrc[0];
ZeroRectCorner(&dinahs[dynIndex].dest);
QOffsetRect(&dinahs[dynIndex].dest, where->left, where->top);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].hVel = 0;
dinahs[dynIndex].vVel = 0;
dinahs[dynIndex].count = 0;
dinahs[dynIndex].frame = 0;
dinahs[dynIndex].timer = RandomInt(60) + 15;
dinahs[dynIndex].position = 0;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn;
}
break;
case kToaster:
{
short baselineDelta = 0;
if (keepExisting)
baselineDelta = dinahs[dynIndex].dest.top - (where->top - 2);
dinahs[dynIndex].dest = breadSrc[0];
CenterRectInRect(&dinahs[dynIndex].dest, where);
VOffsetRect(&dinahs[dynIndex].dest,
where->top - dinahs[dynIndex].dest.top + baselineDelta);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
dinahs[dynIndex].hVel = where->top + 2; // hVel used as clip
if (!keepExisting)
{
position = who->data.g.height; // reverse engineer init. vel.
velocity = 0;
do
{
velocity++;
position -= velocity;
} while (position > 0);
dinahs[dynIndex].vVel = -velocity;
dinahs[dynIndex].count = velocity; // count = initial velocity
dinahs[dynIndex].frame = (short)who->data.g.delay * 3;
dinahs[dynIndex].timer = dinahs[dynIndex].frame;
dinahs[dynIndex].position = 0; // launch/idle state
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn;
}
}
break;
case kMacPlus:
dinahs[dynIndex].dest = plusScreen1;
ZeroRectCorner(&dinahs[dynIndex].dest);
QOffsetRect(&dinahs[dynIndex].dest,
where->left + playOriginH + 10,
where->top + playOriginV + 7);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].hVel = 0;
dinahs[dynIndex].vVel = 0;
dinahs[dynIndex].count = 0;
dinahs[dynIndex].frame = 0;
dinahs[dynIndex].timer = 0;
dinahs[dynIndex].position = 0;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn;
}
break;
case kTV:
dinahs[dynIndex].dest = tvScreen1;
ZeroRectCorner(&dinahs[dynIndex].dest);
QOffsetRect(&dinahs[dynIndex].dest,
where->left + playOriginH + 17,
where->top + playOriginV + 10);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].hVel = 0;
dinahs[dynIndex].vVel = 0;
dinahs[dynIndex].count = 0;
dinahs[dynIndex].frame = 0;
dinahs[dynIndex].timer = 0;
dinahs[dynIndex].position = 0;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn;
}
break;
case kCoffee:
dinahs[dynIndex].dest = coffeeLight1;
ZeroRectCorner(&dinahs[dynIndex].dest);
QOffsetRect(&dinahs[dynIndex].dest,
where->left + playOriginH + 32,
where->top + playOriginV + 57);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].hVel = 0;
dinahs[dynIndex].vVel = 0;
dinahs[dynIndex].count = 0;
dinahs[dynIndex].frame = 0;
if (isOn)
dinahs[dynIndex].timer = 200;
else
dinahs[dynIndex].timer = 0;
dinahs[dynIndex].position = 0;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn;
}
break;
case kOutlet:
dinahs[dynIndex].dest = outletSrc[0];
ZeroRectCorner(&dinahs[dynIndex].dest);
QOffsetRect(&dinahs[dynIndex].dest,
where->left + playOriginH,
where->top + playOriginV);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].hVel = numLights;
dinahs[dynIndex].vVel = 0;
dinahs[dynIndex].count = ((short)who->data.g.delay * 6) / kTicksPerFrame;
dinahs[dynIndex].frame = 0;
dinahs[dynIndex].timer = dinahs[dynIndex].count;
dinahs[dynIndex].position = 0; // launch/idle state
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn;
}
break;
case kVCR:
dinahs[dynIndex].dest = vcrTime1;
ZeroRectCorner(&dinahs[dynIndex].dest);
QOffsetRect(&dinahs[dynIndex].dest,
where->left + playOriginH + 64,
where->top + playOriginV + 6);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].hVel = 0;
dinahs[dynIndex].vVel = 0;
dinahs[dynIndex].count = 0;
dinahs[dynIndex].frame = 0;
if (isOn)
dinahs[dynIndex].timer = 115;
else
dinahs[dynIndex].timer = 0;
dinahs[dynIndex].position = 0;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn;
}
break;
case kStereo:
dinahs[dynIndex].dest = stereoLight1;
ZeroRectCorner(&dinahs[dynIndex].dest);
QOffsetRect(&dinahs[dynIndex].dest,
where->left + playOriginH + 56,
where->top + playOriginV + 20);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].hVel = 0;
dinahs[dynIndex].vVel = 0;
dinahs[dynIndex].count = 0;
dinahs[dynIndex].frame = 0;
dinahs[dynIndex].timer = 0;
dinahs[dynIndex].position = 0;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn;
}
break;
case kMicrowave:
dinahs[dynIndex].dest = microOn;
ZeroRectCorner(&dinahs[dynIndex].dest);
QOffsetRect(&dinahs[dynIndex].dest,
where->left + playOriginH + 14,
where->top + playOriginV + 13);
dinahs[dynIndex].dest.right = dinahs[dynIndex].dest.left + 48;
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].hVel = 0;
dinahs[dynIndex].vVel = 0;
dinahs[dynIndex].count = 0;
dinahs[dynIndex].frame = 0;
dinahs[dynIndex].timer = 0;
dinahs[dynIndex].position = 0;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn;
}
break;
case kBalloon:
{
short baselineDelta = 0;
if (keepExisting)
baselineDelta = dinahs[dynIndex].dest.bottom - kBalloonStart;
dinahs[dynIndex].dest = balloonSrc[0];
ZeroRectCorner(&dinahs[dynIndex].dest);
QOffsetRect(&dinahs[dynIndex].dest, where->left, 0);
dinahs[dynIndex].dest.bottom = kBalloonStart + baselineDelta;
dinahs[dynIndex].dest.top = dinahs[dynIndex].dest.bottom -
RectTall(&balloonSrc[0]);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].hVel = 0;
dinahs[dynIndex].vVel = -2;
dinahs[dynIndex].count = ((short)who->data.h.delay * 6) / kTicksPerFrame;
dinahs[dynIndex].frame = 0;
dinahs[dynIndex].timer = dinahs[dynIndex].count;
dinahs[dynIndex].position = 0;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn; // initially idle
}
}
break;
case kCopterLf:
case kCopterRt:
{
short baselineDeltaH = 0;
short baselineDeltaV = 0;
if (keepExisting)
{
baselineDeltaH = dinahs[dynIndex].dest.left - dinahs[dynIndex].position;
baselineDeltaV = dinahs[dynIndex].dest.top - kCopterStart;
}
dinahs[dynIndex].dest = copterSrc[0];
ZeroRectCorner(&dinahs[dynIndex].dest);
QOffsetRect(&dinahs[dynIndex].dest, where->left, 0);
dinahs[dynIndex].dest.top = kCopterStart + baselineDeltaV;
dinahs[dynIndex].dest.bottom = dinahs[dynIndex].dest.top +
RectTall(&copterSrc[0]);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].position = dinahs[dynIndex].dest.left;
if (what == kCopterLf)
dinahs[dynIndex].hVel = -1;
else
dinahs[dynIndex].hVel = 1;
dinahs[dynIndex].vVel = 2;
dinahs[dynIndex].count = ((short)who->data.h.delay * 6) / kTicksPerFrame;
dinahs[dynIndex].frame = 0;
dinahs[dynIndex].timer = dinahs[dynIndex].count;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn; // initially idle
}
}
break;
case kDartLf:
case kDartRt:
dinahs[dynIndex].dest = dartSrc[0];
ZeroRectCorner(&dinahs[dynIndex].dest);
if (what == kDartLf)
{
QOffsetRect(&dinahs[dynIndex].dest,
kRoomWide - RectWide(&dartSrc[0]), where->top);
dinahs[dynIndex].hVel = -kDartVelocity;
dinahs[dynIndex].frame = 0;
}
else
{
QOffsetRect(&dinahs[dynIndex].dest, 0, where->top);
dinahs[dynIndex].hVel = kDartVelocity;
dinahs[dynIndex].frame = 2;
}
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
dinahs[dynIndex].position = dinahs[dynIndex].dest.top;
if (!keepExisting)
{
dinahs[dynIndex].vVel = 2;
dinahs[dynIndex].count = ((short)who->data.h.delay * 6) / kTicksPerFrame;
dinahs[dynIndex].timer = dinahs[dynIndex].count;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn; // initially idle
}
break;
case kBall:
{
short baselineDelta = 0;
if (keepExisting)
baselineDelta = dinahs[dynIndex].dest.bottom - dinahs[dynIndex].position;
dinahs[dynIndex].dest = ballSrc[0];
ZeroRectCorner(&dinahs[dynIndex].dest);
QOffsetRect(&dinahs[dynIndex].dest,
where->left, where->top + baselineDelta);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].position = dinahs[dynIndex].dest.bottom;
dinahs[dynIndex].hVel = 0;
position = who->data.h.length; // reverse engineer init. vel.
velocity = 0;
evenFrame = true;
lilFrame = true;
do
{
if (lilFrame)
velocity++;
lilFrame = !lilFrame;
position -= velocity;
} while (position > 0);
dinahs[dynIndex].vVel = -velocity;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].count = -velocity; // count = initial velocity
dinahs[dynIndex].frame = 0;
dinahs[dynIndex].timer = 0;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].active = isOn;
}
}
break;
case kDrip:
{
short baselineDelta = 0;
if (keepExisting)
baselineDelta = dinahs[dynIndex].dest.top - dinahs[dynIndex].hVel;
dinahs[dynIndex].dest = dripSrc[0];
CenterRectInRect(&dinahs[dynIndex].dest, where);
VOffsetRect(&dinahs[dynIndex].dest,
where->top - dinahs[dynIndex].dest.top + baselineDelta);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].hVel = dinahs[dynIndex].dest.top; // remember
dinahs[dynIndex].position = dinahs[dynIndex].dest.top +
who->data.h.length;
dinahs[dynIndex].vVel = 0;
dinahs[dynIndex].count = ((short)who->data.h.delay * 6) / kTicksPerFrame;
dinahs[dynIndex].frame = 3;
dinahs[dynIndex].timer = dinahs[dynIndex].count;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn;
}
}
break;
case kFish:
{
short baselineDelta = 0;
if (keepExisting)
baselineDelta = dinahs[dynIndex].dest.bottom - dinahs[dynIndex].position;
dinahs[dynIndex].dest = fishSrc[0];
QOffsetRect(&dinahs[dynIndex].dest,
where->left + 10, where->top + 8 + baselineDelta);
dinahs[dynIndex].whole = dinahs[dynIndex].dest;
if (!keepExisting)
{
dinahs[dynIndex].position = dinahs[dynIndex].dest.bottom;
dinahs[dynIndex].hVel = ((short)who->data.h.delay * 6) / kTicksPerFrame;
position = who->data.g.height; // reverse engineer init. vel.
velocity = 0;
evenFrame = true;
lilFrame = true;
do
{
if (lilFrame)
velocity++;
lilFrame = !lilFrame;
position -= velocity;
} while (position > 0);
dinahs[dynIndex].vVel = -velocity;
dinahs[dynIndex].count = -velocity; // count = initial velocity
dinahs[dynIndex].frame = 0;
dinahs[dynIndex].timer = dinahs[dynIndex].hVel;
dinahs[dynIndex].room = room;
dinahs[dynIndex].byte0 = (Byte)index;
dinahs[dynIndex].byte1 = 0;
dinahs[dynIndex].moving = false;
dinahs[dynIndex].active = isOn;
}
}
break;
default:
break;
}
return dynIndex;
}

View File

@@ -8,12 +8,14 @@
#include "PLResources.h"
#include "PLPasStr.h"
#include "DisplayDeviceManager.h"
#include "Externs.h"
#include "Environ.h"
#include "HostDisplayDriver.h"
#include "HostSystemServices.h"
#include "MenuManager.h"
#include "IGpDisplayDriver.h"
#include "WindowManager.h"
#define kSwitchDepthAlert 130
#define kSetMemoryAlert 180
@@ -193,8 +195,7 @@ Boolean DoWeHaveSoundManager3 (void)
Boolean DoWeHaveQuickTime (void)
{
PL_NotYetImplemented_TODO("Movies");
return false;
return true;
}
//-------------------------------------------------------------- DoWeHaveDragManager
@@ -273,6 +274,30 @@ short HowManyUsableScreens (Boolean use1Bit, Boolean use4Bit, Boolean use8Bit)
return 1;
}
//-------------------------------------------------------------- FlushResolutionChange
void FlushResolutionChange(void)
{
if (thisMac.isResolutionDirty)
{
GetDeviceRect(&thisMac.fullScreen);
thisMac.constrainedScreen = thisMac.fullScreen;
if (thisMac.constrainedScreen.Width() > kMaxViewWidth)
{
thisMac.constrainedScreen.left = 0;
thisMac.constrainedScreen.right = kMaxViewWidth;
}
if (thisMac.constrainedScreen.Height() > kMaxViewHeight)
{
thisMac.constrainedScreen.top = 0;
thisMac.constrainedScreen.bottom = kMaxViewHeight;
}
thisMac.gray = thisMac.fullScreen;
thisMac.gray.top = 20;
thisMac.isResolutionDirty = false;
}
}
//-------------------------------------------------------------- CheckOurEnvirons
// Calls all the above functions in order to fill out a sort of "spec sheet"É
// for the current Mac.
@@ -294,10 +319,45 @@ void CheckOurEnvirons (void)
thisMac.can4Bit = true;
thisMac.can8Bit = true;
thisMac.numScreens = HowManyUsableScreens(false, true, true);
GetDeviceRect(&thisMac.screen);
thisMac.wasDepth = WhatsOurDepth();
thisMac.wasColorOrGray = AreWeColorOrGrayscale();
thisMac.isResolutionDirty = true;
FlushResolutionChange();
}
//-------------------------------------------------------------- HandleResolutionChange
// Installs handler
void HandleResolutionChange(uint32_t prevWidth, uint32_t prevHeight, uint32_t newWidth, uint32_t newHeight)
{
PortabilityLayer::WindowManager::GetInstance()->HandleScreenResolutionChange(prevWidth, prevHeight, newWidth, newHeight);
PortabilityLayer::MenuManager::GetInstance()->DrawMenuBar();
thisMac.isResolutionDirty = true; // Because of legacy code, we don't want to update thisMac.screen immediately, but rather, let the editor or game pick it up
}
class GpAppResolutionChangeHandler final : public PortabilityLayer::DisplayDeviceManager::IResolutionChangeHandler
{
public:
void OnResolutionChanged(uint32_t prevWidth, uint32_t prevHeight, uint32_t newWidth, uint32_t newHeight) override
{
HandleResolutionChange(prevWidth, prevHeight, newWidth, newHeight);
}
void AdjustRequestedResolution(uint32_t &width, uint32_t &height) override
{
}
static GpAppResolutionChangeHandler ms_instance;
};
GpAppResolutionChangeHandler GpAppResolutionChangeHandler::ms_instance;
//-------------------------------------------------------------- InstallResolutionHandler
// Installs handler
void InstallResolutionHandler(void)
{
PortabilityLayer::DisplayDeviceManager::GetInstance()->SetResolutionChangeHandler(&GpAppResolutionChangeHandler::ms_instance);
}
//-------------------------------------------------------------- ReflectMonitor2Environs
@@ -411,7 +471,7 @@ void CheckMemorySize (void)
RedAlert(kErrNoMemory);
else
bytesNeeded += musicBytes;
bytesNeeded += 4L * (long)thisMac.screen.bottom; // main screen
bytesNeeded += 4L * (long)thisMac.constrainedScreen.bottom; // main screen
bytesNeeded += (((long)houseRect.right - (long)houseRect.left) *
((long)houseRect.bottom + 1 - (long)houseRect.top) *
(long)thisMac.isDepth) / 8L; // work map

View File

@@ -10,7 +10,7 @@
typedef struct
{
Rect screen, gray;
Rect fullScreen, constrainedScreen, gray;
long dirID;
short wasDepth, isDepth;
short numScreens;
@@ -28,9 +28,10 @@ typedef struct
Boolean hasSM3;
Boolean hasQT;
Boolean hasDrag;
Boolean isResolutionDirty;
} macEnviron;
extern macEnviron thisMac;
void FlushResolutionChange(void);

View File

@@ -17,6 +17,7 @@
#include "House.h"
#include "InputManager.h"
#include "ObjectEdit.h"
#include "WindowManager.h"
short BitchAboutColorDepth (void);
@@ -74,18 +75,15 @@ void HandleMouseEvent (const GpMouseInputEvent &theEvent, uint32_t tick)
switch (thePart)
{
case inMenuBar:
case RegionIDs::kMenuBar:
menuChoice = MenuSelect(evtPoint);
DoMenuChoice(menuChoice);
break;
case inDrag:
DragWindow(whichWindow, evtPoint, &thisMac.screen);
case RegionIDs::kTitleBar:
PortabilityLayer::WindowManager::GetInstance()->DragWindow(whichWindow, evtPoint, thisMac.fullScreen);
if (whichWindow == mainWindow)
{
SendBehind(mainWindow, (WindowPtr)0L);
GetWindowLeftTop(whichWindow, &isEditH, &isEditV);
}
else if (whichWindow == mapWindow)
GetWindowLeftTop(whichWindow, &isMapH, &isMapV);
else if (whichWindow == toolsWindow)
@@ -94,10 +92,9 @@ void HandleMouseEvent (const GpMouseInputEvent &theEvent, uint32_t tick)
GetWindowLeftTop(whichWindow, &isLinkH, &isLinkV);
else if (whichWindow == coordWindow)
GetWindowLeftTop(whichWindow, &isCoordH, &isCoordV);
HiliteAllWindows();
break;
case inGoAway:
case RegionIDs::kClose:
if (TrackGoAway(whichWindow, evtPoint))
{
if (whichWindow == mapWindow)
@@ -111,7 +108,7 @@ void HandleMouseEvent (const GpMouseInputEvent &theEvent, uint32_t tick)
}
break;
case inGrow:
case RegionIDs::kExpand:
if (whichWindow == mapWindow)
{
newSize = GrowWindow(mapWindow, evtPoint, &thisMac.gray);
@@ -119,13 +116,7 @@ void HandleMouseEvent (const GpMouseInputEvent &theEvent, uint32_t tick)
}
break;
case inZoomIn:
case inZoomOut:
if (TrackBox(whichWindow, evtPoint, thePart))
ZoomWindow(whichWindow, thePart, true);
break;
case inContent:
case RegionIDs::kContent:
if (whichWindow == mainWindow)
{
hDelta = evtPoint.h - lastWhere.h;
@@ -153,7 +144,7 @@ void HandleMouseEvent (const GpMouseInputEvent &theEvent, uint32_t tick)
HandleLinkClick(evtPoint);
break;
default:
default:
break;
}
}
@@ -169,7 +160,7 @@ void HandleKeyEvent (const KeyDownStates &keyStates, const GpKeyboardInputEvent
const bool optionDown = keyStates.IsSet(PL_KEY_EITHER_SPECIAL(kAlt));
if ((commandDown) && (!optionDown))
DoMenuChoice(MenuKey(static_cast<int>(theChar)));
DoMenuChoice(MenuKey(theChar));
else
{
switch (theChar)
@@ -358,11 +349,6 @@ void HandleUpdateEvent (EventRecord *theEvent)
UpdateCoordWindow();
EndUpdate(coordWindow);
}
else if ((WindowPtr)theEvent->message == menuWindow)
{
UpdateMenuBarWindow(menuWindow->GetDrawSurface());
EndUpdate(menuWindow);
}
}
//-------------------------------------------------------------- HandleOSEvent
@@ -435,6 +421,48 @@ void HandleHighLevelEvent (EventRecord *theEvent)
}
#endif
//-------------------------------------------------------------- HandleSplashResolutionChange
void HandleSplashResolutionChange(void)
{
FlushResolutionChange();
RecomputeInterfaceRects();
RecreateOffscreens();
CloseMainWindow();
OpenMainWindow();
UpdateMainWindow();
//ResetLocale(true);
InitScoreboardMap();
//RefreshScoreboard(wasScoreboardTitleMode);
//DumpScreenOn(&justRoomsRect);
}
void HandleEditorResolutionChange(void)
{
FlushResolutionChange();
RecomputeInterfaceRects();
RecreateOffscreens();
CloseMainWindow();
OpenMainWindow();
UpdateMainWindow();
//ResetLocale(true);
InitScoreboardMap();
//RefreshScoreboard(wasScoreboardTitleMode);
//DumpScreenOn(&justRoomsRect);
if (toolsWindow)
PortabilityLayer::WindowManager::GetInstance()->PutWindowBehind(toolsWindow, PortabilityLayer::WindowManager::GetInstance()->GetPutInFrontSentinel());
if (mapWindow)
PortabilityLayer::WindowManager::GetInstance()->PutWindowBehind(mapWindow, PortabilityLayer::WindowManager::GetInstance()->GetPutInFrontSentinel());
}
//-------------------------------------------------------------- HandleIdleTask
// Handle some processing during event lulls.
@@ -442,7 +470,12 @@ void HandleIdleTask (void)
{
if (theMode == kEditMode)
{
SetPort((GrafPtr)mainWindow);
if (thisMac.isResolutionDirty)
{
HandleEditorResolutionChange();
}
SetPort(&mainWindow->GetDrawSurface()->m_port);
DoMarquee();
if ((autoRoomEdit) && (newRoomNow))
@@ -452,6 +485,14 @@ void HandleIdleTask (void)
newRoomNow = false;
}
}
if (theMode == kSplashMode)
{
if (thisMac.isResolutionDirty)
{
HandleSplashResolutionChange();
}
}
}
//-------------------------------------------------------------- HandleEvent
@@ -515,28 +556,6 @@ void HandleEvent (void)
}
}
//-------------------------------------------------------------- HiliteAllWindows
// Ugly kludge in order to keep "floating windows" (palettes) on top ofÉ
// the main window.
void HiliteAllWindows (void)
{
PL_NotYetImplemented_TODO("DeleteMe");
#if 0
if (mainWindow != nil)
HiliteWindow(mainWindow, true);
if (mapWindow != nil)
HiliteWindow(mapWindow, true);
if (toolsWindow != nil)
HiliteWindow(toolsWindow, true);
if (coordWindow != nil)
HiliteWindow(coordWindow, true);
if (linkWindow != nil)
HiliteWindow(linkWindow, true);
#endif
}
//-------------------------------------------------------------- IgnoreThisClick
// Another inelegant kludge designed to temporarily prevent an unwantedÉ

View File

@@ -135,7 +135,8 @@ void BackSpinCursor (short);
void ColorText (DrawSurface *surface, const Point &, StringPtr, long); // --- ColorUtils.c
void ColorRect (DrawSurface *surface, const Rect &, long);
void ColorOval (DrawSurface *surface, const Rect &, long);
void ColorRegion (DrawSurface *surface, PortabilityLayer::ScanlineMask *scanlineMask, long colorIndex);
void ColorOvalMaskPattern (DrawSurface *surface, const Rect &, long, bool, const uint8_t *);
void ColorRegionMaskPattern (DrawSurface *surface, PortabilityLayer::ScanlineMask *scanlineMask, long colorIndex, bool isMask, const uint8_t *pattern);
void ColorLine (DrawSurface *surface, short, short, short, short, long);
void HiliteRect (DrawSurface *surface, const Rect &rect, short, short);
void ColorFrameRect (DrawSurface *surface, const Rect &theRect, long colorIndex);
@@ -161,12 +162,12 @@ void FillScreenRed (void);
void DumpToResEditFile (Ptr, long);
void HandleEvent (void); // --- Event.c
void HiliteAllWindows (void);
void IgnoreThisClick (void);
short WhatsOurDepth (void); // --- Environs.c
void SwitchToDepth (short, Boolean);
void CheckOurEnvirons (void);
void InstallResolutionHandler (void);
//void ReflectSecondMonitorEnvirons (Boolean, Boolean, Boolean);
void HandleDepthSwitching (void);
void RestoreColorDepth (void);

View File

@@ -102,10 +102,10 @@ void SetUpFinalScreen (void)
do
{
GetLineOfText(tempStr, count, subStr);
offset = ((thisMac.screen.right - thisMac.screen.left) -
surface->MeasureString(subStr)) / 2;
surface->SetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold);
offset = ((thisMac.constrainedScreen.right - thisMac.constrainedScreen.left) -
surface->MeasureString(subStr)) / 2;
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
const Point textShadowPos = Point::Create(offset + 1, textDown + 33 + (count * 20));
@@ -146,6 +146,12 @@ void DoGameOverStarAnimation (void)
long nextLoop;
short which, i, count, pass;
Boolean noInteruption;
short starFallSpeed = kStarFalls;
const int kStarSpacing = 32;
const int kAngelSpeed = 2;
const int kStarsReserved = 5;
const int kMaxFramesAlive = (kStarSpacing * kStarsReserved + kAngelSpeed - 1) / kAngelSpeed;
angelDest = angelSrcRect;
QOffsetRect(&angelDest, -96, 0);
@@ -154,14 +160,19 @@ void DoGameOverStarAnimation (void)
count = 0;
pass = 0;
FlushEvents(everyEvent, 0);
if (workSrcRect.bottom - angelDest.bottom > kMaxFramesAlive * starFallSpeed)
starFallSpeed = (workSrcRect.bottom - angelDest.bottom + kMaxFramesAlive - 1) / kMaxFramesAlive;
while (noInteruption)
{
if ((angelDest.left % 32) == 0) // add a star
if ((angelDest.left % kStarSpacing) == 0) // add a star
{
PlayPrioritySound(kMysticSound, kMysticPriority);
which = angelDest.left / 32;
which = which % 5;
which = angelDest.left / kStarSpacing;
which = which % kStarsReserved;
if (which < 0)
which += kStarsReserved;
ZeroRectCorner(&pages[which].dest);
QOffsetRect(&pages[which].dest, angelDest.left, angelDest.bottom);
if (count < (which + 1))
@@ -182,13 +193,13 @@ void DoGameOverStarAnimation (void)
&pages[i].dest);
pages[i].was = pages[i].dest;
pages[i].was.top -= kStarFalls;
pages[i].was.top -= starFallSpeed;
AddRectToWorkRectsWhole(&pages[i].was);
AddRectToBackRects(&pages[i].dest);
if (pages[i].dest.top < workSrcRect.bottom)
QOffsetRect(&pages[i].dest, 0, kStarFalls);
QOffsetRect(&pages[i].dest, 0, starFallSpeed);
}
if (angelDest.left <= (workSrcRect.right + 2))
@@ -197,11 +208,11 @@ void DoGameOverStarAnimation (void)
(BitMap *)*GetGWorldPixMap(angelMaskMap),
(BitMap *)*GetGWorldPixMap(workSrcMap),
&angelSrcRect, &angelSrcRect, &angelDest);
angelDest.left -= 2;
angelDest.left -= kAngelSpeed;
AddRectToWorkRectsWhole(&angelDest);
angelDest.left += 2;
angelDest.left += kAngelSpeed;
AddRectToBackRects(&angelDest);
QOffsetRect(&angelDest, 2, 0);
QOffsetRect(&angelDest, kAngelSpeed, 0);
pass = 0;
}
@@ -283,14 +294,14 @@ void InitDiedGameOver (void)
for (i = 0; i < 8; i++) // initialize dest page rects
{
QSetRect(&pages[i].dest, 0, 0, 32, 32);
CenterRectInRect(&pages[i].dest, &thisMac.screen);
QOffsetRect(&pages[i].dest, -thisMac.screen.left, -thisMac.screen.top);
CenterRectInRect(&pages[i].dest, &thisMac.constrainedScreen);
QOffsetRect(&pages[i].dest, -thisMac.constrainedScreen.left, -thisMac.constrainedScreen.top);
if (i < 4)
QOffsetRect(&pages[i].dest, -kPageSpacing * (4 - i), 0);
else
QOffsetRect(&pages[i].dest, kPageSpacing * (i - 3), 0);
QOffsetRect(&pages[i].dest, (thisMac.screen.right - thisMac.screen.left) / -2,
(thisMac.screen.right - thisMac.screen.left) / -2);
QOffsetRect(&pages[i].dest, (thisMac.constrainedScreen.right - thisMac.constrainedScreen.left) / -2,
(thisMac.constrainedScreen.right - thisMac.constrainedScreen.left) / -2);
if (pages[i].dest.left % 2 == 1)
QOffsetRect(&pages[i].dest, 1, 0);
pages[i].was = pages[i].dest;
@@ -306,7 +317,7 @@ void InitDiedGameOver (void)
}
pagesStuck = 0;
stopPages = ((thisMac.screen.bottom - thisMac.screen.top) / 2) - 16;
stopPages = ((thisMac.constrainedScreen.bottom - thisMac.constrainedScreen.top) / 2) - 16;
}
//-------------------------------------------------------------- HandlePages

View File

@@ -265,7 +265,7 @@
#define kMaxDynamicObs 18
#define kMaxMasterObjects 216 // kMaxRoomObs * 9
#define kMaxViewWidth 1536
#define kMaxViewHeight 1026
#define kMaxViewHeight (kTileHigh*3+20)
#define kSelectTool 0
@@ -510,8 +510,6 @@
#define kNoCeilingLimit -10
#define kNoFloorLimit 332
#define kScoreboardHigh 0
#define kScoreboardLow 1
#define kScoreboardTall 20
#define kHouseVersion 0x0200

View File

@@ -25,24 +25,26 @@ void ToggleCoordinateWindow (void);
void NilSavedMaps (void); // --- DynamicMaps.c
SInt16 BackUpToSavedMap (Rect *, SInt16, SInt16);
SInt16 ReBackUpSavedMap (Rect *, SInt16, SInt16);
SInt16 RemoveFromSavedMap(SInt16);
void RestoreFromSavedMap (SInt16, SInt16, Boolean);
void AddSparkle (Rect *);
void AddFlyingPoint (Rect *, SInt16, SInt16, SInt16);
void ReBackUpFlames (SInt16, SInt16);
Boolean ReBackUpFlames (SInt16, SInt16, SInt16, SInt16);
void AddCandleFlame (SInt16, SInt16, SInt16, SInt16);
void ReBackUpTikiFlames (SInt16, SInt16);
Boolean ReBackUpTikiFlames (SInt16, SInt16, SInt16, SInt16);
void AddTikiFlame (SInt16, SInt16, SInt16, SInt16);
void ReBackUpBBQCoals (SInt16, SInt16);
Boolean ReBackUpBBQCoals (SInt16, SInt16, SInt16, SInt16);
void AddBBQCoals (SInt16, SInt16, SInt16, SInt16);
void ReBackUpPendulum (SInt16, SInt16);
Boolean ReBackUpPendulum (SInt16, SInt16, SInt16, SInt16);
void AddPendulum (SInt16, SInt16, SInt16, SInt16);
void ReBackUpStar (SInt16, SInt16);
void ReBackUpStar (SInt16, SInt16, SInt16, SInt16);
void AddStar (SInt16, SInt16, SInt16, SInt16);
void StopPendulum (SInt16, SInt16);
void StopStar (SInt16, SInt16);
void AddAShreddedGlider (Rect *);
void RemoveShreds (void);
void ZeroFlamesAndTheLike (void);
void RemoveSavedMapsNotInRoom (SInt16);
void CheckDynamicCollision (SInt16, gliderPtr, Boolean); // --- Dynamics.c
Boolean DidBandHitDynamic (SInt16);
@@ -73,17 +75,21 @@ void HandleFish (SInt16);
void HandleDynamics (void); // --- Dynamics3.c
void RenderDynamics (void);
void ZeroDinahs (void);
SInt16 AddDynamicObject (SInt16, Rect *, objectType *, SInt16, SInt16, Boolean);
void ZeroDinahsNotInRoom (SInt16);
SInt16 AddDynamicObject(SInt16 what, Rect *where, objectType *who, SInt16 room, SInt16 index, Boolean isOn, Boolean keepExisting);
void DoGameOver (void); // --- GameOver.c
void FlagGameOver (void);
void DoDiedGameOver (void);
void HandleGrease (void); // --- Grease.c
SInt16 ReBackUpGrease (SInt16, SInt16);
SInt16 ReBackUpGrease (SInt16 where, SInt16 who, SInt16 h, SInt16 v);
SInt16 AddGrease (SInt16, SInt16, SInt16, SInt16, SInt16, Boolean);
void SpillGrease (SInt16, SInt16);
void RedrawAllGrease (void);
void FixupFallenGrease(SInt16 where, SInt16 who, SInt16 h, SInt16 v, Boolean *isDynamic);
void RemapGreaseSavedMap(SInt16 removedItem, SInt16 substituteItem);
void DoHighScores (void); // --- HighScores.c
void SortHighScores (void);
@@ -132,6 +138,7 @@ void FlagStillOvers (gliderPtr);
void InitializeMenus (void); // --- InterfaceInit.c
void GetExtraCursors (void);
void RecomputeInterfaceRects (void);
void VariableInit (void);
void GetDemoInput (gliderPtr); // --- Input.c
@@ -147,7 +154,6 @@ void HandleLinkClick (Point);
void RedrawSplashScreen (void); // --- MainWindow.c
void UpdateMainWindow (void);
void UpdateMenuBarWindow (DrawSurface *surface);
void OpenMainWindow (void);
void CloseMainWindow (void);
void ZoomBetweenWindows (void);
@@ -173,10 +179,10 @@ void StartMarqueeHandled (Rect *, SInt16, SInt16);
void StopMarquee (void);
void PauseMarquee (void);
void ResumeMarquee (void);
void DragOutMarqueeRect (Point, Rect *);
void DragMarqueeRect (DrawSurface *, Point, Rect *, Boolean, Boolean);
void DragMarqueeHandle (DrawSurface *, Point, SInt16 *);
void DragMarqueeCorner (DrawSurface *, Point, SInt16 *, SInt16 *, Boolean);
void DragOutMarqueeRect (Window *, Point, Rect *);
void DragMarqueeRect (Window *, DrawSurface *, Point, Rect *, Boolean, Boolean);
void DragMarqueeHandle (Window *, DrawSurface *, Point, SInt16 *);
void DragMarqueeCorner (Window *, DrawSurface *, Point, SInt16 *, SInt16 *, Boolean);
Boolean MarqueeHasHandles (SInt16 *, SInt16 *);
Boolean PtInMarqueeHandle (Point);
void SetMarqueeGliderRect (SInt16, SInt16);
@@ -257,8 +263,8 @@ void DrawBlueClock (Rect *);
void DrawYellowClock (Rect *);
void DrawCuckoo (Rect *);
void DrawSimplePrizes (SInt16, Rect *);
void DrawGreaseRt (Rect *, SInt16, Boolean);
void DrawGreaseLf (Rect *, SInt16, Boolean);
void DrawGreaseRt (Rect *, SInt16, Boolean, Boolean);
void DrawGreaseLf (Rect *, SInt16, Boolean, Boolean);
void DrawFoil (Rect *);
void DrawInvisBonus (Rect *);
void DrawSlider (Rect *);
@@ -306,7 +312,7 @@ void DrawCustPictSansWhite (SInt16, Rect *);
void DrawARoomsObjects (SInt16, Boolean); // --- ObjectDrawAll.c
void DoSelectionClick (DrawSurface *, Point, Boolean); // --- ObjectEdit.c
void DoSelectionClick (Window *, DrawSurface *, Point, Boolean); // --- ObjectEdit.c
void DoNewObjectClick (Point);
void DeleteObject (void);
void DuplicateObject (void);
@@ -407,7 +413,8 @@ Boolean DoesRoomHaveFloor (void);
Boolean DoesRoomHaveCeiling (void);
void ReadyLevel (void); // --- RoomGraphics.c
void DrawLocale (void);
void ResetLocale (Boolean soft);
void DrawLocale (Boolean soft);
void RedrawRoomLighting (void);
Boolean PictIDExists (SInt16); // --- RoomInfo.c
@@ -428,8 +435,6 @@ void QuickBatteryRefresh (Boolean);
void QuickBandsRefresh (Boolean);
void QuickFoilRefresh (Boolean);
void HandleScore (void);
void AdjustScoreboardHeight (void);
void BlackenScoreboard (DrawSurface *);
//void PutRoomScrap (void); // --- Scrap.c
//void PutObjectScrap (void);
@@ -470,6 +475,7 @@ void InitEnemies (void);
void CreateOffscreens (void); // --- StructuresInit2.c
void CreatePointers (void);
void InitSrcRects (void);
PLError_t RecreateOffscreens (void);
void UpdateToolsWindow (void); // --- Tools.c
void EraseSelectedTool (void);

View File

@@ -39,7 +39,7 @@ extern Rect clutterSrcRect;
extern Rect flowerSrc[];
extern Rect *srcRects;
extern Movie theMovie;
extern AnimationPlayer theMovie;
extern Rect movieRect;
extern Boolean hasMovie, tvInRoom;

View File

@@ -83,6 +83,7 @@
<Import Project="GpApp.props" />
<Import Project="..\Common.props" />
<Import Project="..\GpCommon.props" />
<Import Project="..\Release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />

View File

@@ -25,6 +25,7 @@ public:
void PL_HostFontHandler_SetInstance(PortabilityLayer::HostFontHandler *instance) override;
void PL_HostVOSEventQueue_SetInstance(PortabilityLayer::HostVOSEventQueue *instance) override;
void PL_InstallHostSuspendHook(PortabilityLayer::HostSuspendHook_t hook, void *context) override;
void PL_AdjustRequestedResolution(unsigned int &width, unsigned int &height) override;
};
@@ -79,6 +80,16 @@ void GpAppInterfaceImpl::PL_InstallHostSuspendHook(PortabilityLayer::HostSuspend
PortabilityLayer::InstallHostSuspendHook(hook, context);
}
void GpAppInterfaceImpl::PL_AdjustRequestedResolution(unsigned int &width, unsigned int &height)
{
uint32_t w32 = width;
uint32_t h32 = height;
PortabilityLayer::DisplayDeviceManager::GetInstance()->GetResolutionChangeHandler()->AdjustRequestedResolution(w32, h32);
width = w32;
height = h32;
}
static GpAppInterfaceImpl gs_application;

View File

@@ -28,8 +28,7 @@ short numGrease;
extern hotPtr hotSpots;
extern savedType savedMaps[];
extern Point shieldPt;
extern Rect greaseSrcRt[], greaseSrcLf[], shieldRect;
extern Rect greaseSrcRt[], greaseSrcLf[];
//============================================================== Functions
@@ -168,7 +167,7 @@ void BackupGrease (Rect *src, short index, Boolean isRight)
// off or on the lights). It assumes certain data strucutures areÉ
// already declared from an earlier call to the above funciton.
short ReBackUpGrease (short where, short who)
short ReBackUpGrease (short where, short who, short h, short v)
{
Rect src;
short i;
@@ -179,6 +178,13 @@ short ReBackUpGrease (short where, short who)
{
if ((grease[i].mode == kGreaseIdle) || (grease[i].mode == kGreaseFalling))
{
greasePtr greaseItem = &grease[i];
const short hDelta = h - grease[i].dest.left;
const short vDelta = v - grease[i].dest.top;
QOffsetRect(&greaseItem->dest, hDelta, vDelta);
greaseItem->start += hDelta;
greaseItem->stop += hDelta;
src = grease[i].dest;
BackupGrease(&src, grease[i].mapNum, grease[i].isRight);
}
@@ -269,10 +275,12 @@ void RedrawAllGrease (void)
for (i = 0; i < numGrease; i++)
{
if (grease[i].mode == kGreaseIdle)
continue;
src = hotSpots[grease[i].hotNum].bounds;
if ((grease[i].where == thisRoomNumber) &&
((src.bottom - src.top) == 2) &&
(grease[i].mode != kGreaseIdle))
((src.bottom - src.top) == 2))
{
QOffsetRect(&src, playOriginH, playOriginV);
@@ -288,3 +296,41 @@ void RedrawAllGrease (void)
}
}
void FixupFallenGrease(SInt16 where, SInt16 who, SInt16 h, SInt16 v, Boolean *isDynamic)
{
short i;
for (i = 0; i < numGrease; i++)
{
greasePtr greaseItem = grease + i;
if ((greaseItem->where == where) && (greaseItem->who == who))
{
short hDelta = h - greaseItem->dest.left;
short vDelta = v - greaseItem->dest.top;
QOffsetRect(&greaseItem->dest, hDelta, vDelta);
greaseItem->start += hDelta;
greaseItem->stop += hDelta;
if (greaseItem->mode != kGreaseIdle)
{
hotPtr hotSpot = &hotSpots[greaseItem->hotNum];
//QOffsetRect(&hotSpot->bounds, hDelta, vDelta);
}
*isDynamic = true;
return;
}
}
*isDynamic = false;
}
void RemapGreaseSavedMap(SInt16 removedItem, SInt16 substituteItem)
{
for (int i = 0; i < numGrease; i++)
{
if (grease[i].mapNum == substituteItem)
{
grease[i].mapNum = removedItem;
return;
}
}
}

View File

@@ -23,6 +23,7 @@
#include "IOStream.h"
#include "MainWindow.h"
#include "RectUtils.h"
#include "PLStandardColors.h"
#include "PLTimeTaggedVOSEvent.h"
#include "Utilities.h"
@@ -43,10 +44,10 @@ namespace PortabilityLayer
void DrawHighScores (DrawSurface *);
void UpdateNameDialog (Dialog *);
Boolean NameFilter (Dialog *, EventRecord *, short *);
int16_t NameFilter (Dialog *dial, const TimeTaggedVOSEvent *evt);
void GetHighScoreName (short);
void UpdateBannerDialog (Dialog *);
int16_t BannerFilter(Dialog *dialog, const TimeTaggedVOSEvent &evt);
int16_t BannerFilter(Dialog *dialog, const TimeTaggedVOSEvent *evt);
void GetHighScoreBanner (void);
Boolean OpenHighScoresFile (const VFileSpec &spec, PortabilityLayer::IOStream *&outStream);
@@ -69,7 +70,8 @@ void DoHighScores (void)
Rect tempRect;
SpinCursor(3);
SetPort((GrafPtr)workSrcMap);
SetPort(&workSrcMap->m_port);
workSrcMap->SetForeColor(StdColors::Black());
workSrcMap->FillRect(workSrcRect);
QSetRect(&tempRect, 0, 0, 640, 480);
QOffsetRect(&tempRect, splashOriginH, splashOriginV);
@@ -123,7 +125,7 @@ void DrawHighScores (DrawSurface *surface)
PortabilityLayer::RGBAColor whiteColor = PortabilityLayer::RGBAColor::Create(255, 255, 255, 255);
PortabilityLayer::RGBAColor blueColor = PortabilityLayer::RGBAColor::Create(0, 0, 255, 255);
scoreLeft = ((thisMac.screen.right - thisMac.screen.left) - kScoreWide) / 2;
scoreLeft = ((thisMac.constrainedScreen.right - thisMac.constrainedScreen.left) - kScoreWide) / 2;
dropIt = 129 + splashOriginV;
QSetRect(&tempRect, 0, 0, 332, 30);
@@ -397,6 +399,9 @@ Boolean TestHighScore (void)
break;
}
}
if (IsHighScoreForceTop())
placing = 0;
if (placing != -1)
{
@@ -446,7 +451,7 @@ void UpdateNameDialog (Dialog *theDialog)
//-------------------------------------------------------------- NameFilter
// Dialog filter for the "Enter High Score Name" dialog.
int16_t NameFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
int16_t NameFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
{
short nChars;
@@ -457,13 +462,17 @@ int16_t NameFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
keyStroke = false;
}
if (evt.m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
if (!evt)
return -1;
if (evt->m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
{
const GpKeyboardInputEvent &kbEvent = evt.m_vosEvent.m_event.m_keyboardInputEvent;
const GpKeyboardInputEvent &kbEvent = evt->m_vosEvent.m_event.m_keyboardInputEvent;
if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDownChar || kbEvent.m_eventType == GpKeyboardInputEventTypes::kAutoChar)
{
PlayPrioritySound(kTypingSound, kTypingPriority);
keyStroke = true;
return -1; // Don't capture, need this to forward to the editbox
}
else if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDown)
@@ -544,7 +553,7 @@ void UpdateBannerDialog (Dialog *theDialog)
//-------------------------------------------------------------- BannerFilter
// Dialog filter for the "Enter Message" dialog.
int16_t BannerFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
int16_t BannerFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
{
short nChars;
@@ -555,13 +564,17 @@ int16_t BannerFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
keyStroke = false;
}
if (evt.m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
if (!evt)
return -1;
if (evt->m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
{
const GpKeyboardInputEvent &kbEvent = evt.m_vosEvent.m_event.m_keyboardInputEvent;
const GpKeyboardInputEvent &kbEvent = evt->m_vosEvent.m_event.m_keyboardInputEvent;
if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDownChar || kbEvent.m_eventType == GpKeyboardInputEventTypes::kAutoChar)
{
PlayPrioritySound(kTypingSound, kTypingPriority);
keyStroke = true;
return -1; // Don't capture, need this to forward to the editbox
}
else if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDown)

View File

@@ -17,6 +17,7 @@
#include "FileManager.h"
#include "HostFileSystem.h"
#include "House.h"
#include "PLTimeTaggedVOSEvent.h"
#include "RectUtils.h"
#include "ResourceManager.h"
@@ -26,7 +27,9 @@
void UpdateGoToDialog (Dialog *);
Boolean GoToFilter (Dialog *, EventRecord *, short *);
int16_t GoToFilter (Dialog *dial, const TimeTaggedVOSEvent *evt);
extern PortabilityLayer::ResourceArchive *houseResFork;
houseHand thisHouse;
@@ -241,11 +244,7 @@ void WhereDoesGliderBegin (Rect *theRect, short mode)
Boolean HouseHasOriginalPicts (void)
{
short nPicts;
PL_NotYetImplemented(); nPicts = 0;
//nPicts = Count1Resources('PICT');
return (nPicts > 0);
return houseResFork->HasAnyResourcesOfType('PICT');
}
//-------------------------------------------------------------- CountHouseLinks
@@ -596,7 +595,6 @@ void GenerateRetroLinks (void)
void UpdateGoToDialog (Dialog *theDialog)
{
DrawDialog(theDialog);
DrawDefaultButton(theDialog);
FrameDialogItemC(theDialog, 10, kRedOrangeColor8);
}
@@ -604,37 +602,27 @@ void UpdateGoToDialog (Dialog *theDialog)
//-------------------------------------------------------------- GoToFilter
// Dialog filter for the "Go To Room..." dialog.
Boolean GoToFilter (Dialog *dial, EventRecord *event, short *item)
int16_t GoToFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
{
switch (event->what)
if (!evt)
return -1;
if (evt->IsKeyDownEvent())
{
case keyDown:
switch (event->message)
const GpKeyboardInputEvent &keyEvt = evt->m_vosEvent.m_event.m_keyboardInputEvent;
switch (PackVOSKeyCode(keyEvt))
{
case PL_KEY_SPECIAL(kEnter):
case PL_KEY_NUMPAD_SPECIAL(kEnter):
case PL_KEY_SPECIAL(kEnter):
case PL_KEY_NUMPAD_SPECIAL(kEnter):
FlashDialogButton(dial, kOkayButton);
*item = kOkayButton;
return(true);
break;
default:
return(false);
}
break;
case updateEvt:
SetPortDialogPort(dial);
UpdateGoToDialog(dial);
EndUpdate(dial->GetWindow());
event->what = nullEvent;
return(false);
break;
return kOkayButton;
default:
return(false);
break;
return -1;
}
}
return -1;
}
//-------------------------------------------------------------- DoGoToDialog
@@ -666,10 +654,12 @@ Boolean GoToFilter (Dialog *dial, EventRecord *event, short *item)
leaving = false;
canceled = false;
UpdateGoToDialog(theDialog);
while (!leaving)
{
ModalDialog(GoToFilter, &item);
item = theDialog->ExecuteModal(GoToFilter);
if (item == kOkayButton)
{

View File

@@ -11,6 +11,7 @@
#include "PLStringCompare.h"
#include "PLTextUtils.h"
#include "PLPasStr.h"
#include "BitmapImage.h"
#include "DialogManager.h"
#include "Externs.h"
#include "Environ.h"
@@ -34,7 +35,7 @@ void CloseHouseMovie (void);
Boolean IsFileReadOnly (const VFileSpec &);
Movie theMovie;
AnimationPlayer theMovie;
Rect movieRect;
PortabilityLayer::ResourceArchive *houseResFork;
short wasHouseVersion;
@@ -52,31 +53,12 @@ extern Boolean phoneBitSet, bannerStarCountOn;
//============================================================== Functions
//-------------------------------------------------------------- LoopMovie
void LoopMovie (void)
{
THandle<long> theLoop;
UserData theUserData;
short theCount;
theLoop = NewHandle(sizeof(long)).StaticCast<long>();
(**theLoop) = 0;
theUserData = GetMovieUserData(theMovie);
theCount = CountUserDataType(theUserData, 'LOOP');
while (theCount--)
{
RemoveUserData(theUserData, 'LOOP', 1);
}
AddUserData(theUserData, theLoop.StaticCast<void>(), 'LOOP');
}
//-------------------------------------------------------------- OpenHouseMovie
void OpenHouseMovie (void)
{
#ifdef COMPILEQT
TimeBase theTime;
VFileSpec theSpec;
VFileInfo finderInfo;
Handle spaceSaver;
@@ -92,60 +74,24 @@ void OpenHouseMovie (void)
theErr = FSpGetFInfo(theSpec, finderInfo);
if (theErr != PLErrors::kNone)
return;
theErr = OpenMovieFile(theSpec, &movieRefNum, 0);
if (theErr != PLErrors::kNone)
AnimationPackage *anim = AnimationPackage::Create();
if (!anim)
return;
if (!anim->Load(theSpec.m_dir, theSpec.m_name))
{
anim->Destroy();
YellowAlert(kYellowQTMovieNotLoaded, theErr);
return;
}
theErr = NewMovieFromFile(&theMovie, movieRefNum, nil, theSpec.m_name,
newMovieActive, &dataRefWasChanged);
if (theErr != PLErrors::kNone)
{
YellowAlert(kYellowQTMovieNotLoaded, theErr);
theErr = CloseMovieFile(movieRefNum);
return;
}
theErr = CloseMovieFile(movieRefNum);
spaceSaver = NewHandle(307200L);
if (spaceSaver == nil)
{
YellowAlert(kYellowQTMovieNotLoaded, 749);
CloseHouseMovie();
return;
}
GoToBeginningOfMovie(theMovie);
theErr = LoadMovieIntoRam(theMovie,
GetMovieTime(theMovie, 0L), GetMovieDuration(theMovie), 0);
if (theErr != PLErrors::kNone)
{
YellowAlert(kYellowQTMovieNotLoaded, theErr);
spaceSaver.Dispose();
CloseHouseMovie();
return;
}
spaceSaver.Dispose();
theErr = PrerollMovie(theMovie, 0, 0x000F0000);
if (theErr != PLErrors::kNone)
{
YellowAlert(kYellowQTMovieNotLoaded, theErr);
CloseHouseMovie();
return;
}
theTime = GetMovieTimeBase(theMovie);
SetTimeBaseFlags(theTime, loopTimeBase);
SetMovieMasterTimeBase(theMovie, theTime, nil);
LoopMovie();
GetMovieBox(theMovie, &movieRect);
movieRect = (*anim->GetFrame(0))->GetRect();
hasMovie = true;
theMovie.SetPackage(anim);
AnimationManager::GetInstance()->RegisterPlayer(&theMovie);
}
#endif
}
@@ -159,9 +105,10 @@ void CloseHouseMovie (void)
if ((thisMac.hasQT) && (hasMovie))
{
theErr = LoadMovieIntoRam(theMovie,
GetMovieTime(theMovie, 0L), GetMovieDuration(theMovie), flushFromRam);
DisposeMovie(theMovie);
AnimationManager::GetInstance()->RemovePlayer(&theMovie);
theMovie.m_animPackage->Destroy();
theMovie.m_animPackage = nullptr;
}
#endif
hasMovie = false;
@@ -195,8 +142,10 @@ Boolean OpenHouse (void)
houseOpen = true;
OpenHouseResFork();
hasMovie = false;
if (hasMovie)
CloseHouseMovie();
tvInRoom = false;
tvWithMovieNumber = -1;
OpenHouseMovie();

View File

@@ -12,6 +12,11 @@
#include "Externs.h"
#include "DialogManager.h"
#include "DialogUtils.h"
#include "HostDisplayDriver.h"
#include "IGpDisplayDriver.h"
#include "PLArrayView.h"
#include "PLEditboxWidget.h"
#include "PLTimeTaggedVOSEvent.h"
#define kHouseInfoDialogID 1001
@@ -29,7 +34,7 @@
long CountTotalHousePoints (void);
void UpdateHouseInfoDialog (Dialog *);
Boolean HouseFilter (Dialog *, EventRecord *, short *);
int16_t HouseFilter(Dialog *dial, const TimeTaggedVOSEvent *evt);
Boolean WarnLockingHouse (void);
void HowToZeroScores (void);
@@ -107,7 +112,6 @@ void UpdateHouseInfoDialog (Dialog *theDialog)
{
short nChars;
DrawDialog(theDialog);
nChars = GetDialogStringLen(theDialog, kBannerTextItem);
SetDialogNumToStr(theDialog, kBannerNCharsItem, (long)nChars);
nChars = GetDialogStringLen(theDialog, kTrailerTextItem);
@@ -119,7 +123,7 @@ void UpdateHouseInfoDialog (Dialog *theDialog)
//-------------------------------------------------------------- HouseFilter
Boolean HouseFilter (Dialog *dial, EventRecord *event, short *item)
int16_t HouseFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
{
Point mouseIs;
short nChars;
@@ -132,70 +136,66 @@ Boolean HouseFilter (Dialog *dial, EventRecord *event, short *item)
SetDialogNumToStr(dial, kTrailerNCharsItem, (long)nChars);
keyHit = false;
}
switch (event->what)
{
case keyDown:
switch (event->message)
{
case PL_KEY_SPECIAL(kEnter):
case PL_KEY_NUMPAD_SPECIAL(kEnter):
FlashDialogButton(dial, kOkayButton);
*item = kOkayButton;
return(true);
break;
case PL_KEY_SPECIAL(kEscape):
FlashDialogButton(dial, kCancelButton);
*item = kCancelButton;
return(true);
break;
default:
keyHit = true;
return(false);
}
break;
case mouseDown:
return(false);
break;
case mouseUp:
return(false);
break;
case updateEvt:
SetPortDialogPort(dial);
UpdateHouseInfoDialog(dial);
EndUpdate(dial->GetWindow());
event->what = nullEvent;
return(false);
break;
default:
mouseIs = event->where;
mouseIs -= dial->GetWindow()->TopLeftCoord();
if ((PtInRect(mouseIs, &houseEditText1)) ||
(PtInRect(mouseIs, &houseEditText2)))
if (evt)
{
if (evt->m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
{
if (houseCursorIs != kBeamCursor)
const GpKeyboardInputEvent &keyEvt = evt->m_vosEvent.m_event.m_keyboardInputEvent;
if (keyEvt.m_eventType == GpKeyboardInputEventTypes::kDown)
{
SetBuiltinCursor(iBeamCursor);
houseCursorIs = kBeamCursor;
switch (PackVOSKeyCode(keyEvt))
{
case PL_KEY_NUMPAD_SPECIAL(kEnter):
FlashDialogButton(dial, kOkayButton);
return kOkayButton;
case PL_KEY_SPECIAL(kEscape):
FlashDialogButton(dial, kCancelButton);
return kCancelButton;
default:
keyHit = true;
return -1;
}
}
else if (keyEvt.m_eventType == GpKeyboardInputEventTypes::kDownChar || keyEvt.m_eventType == GpKeyboardInputEventTypes::kAutoChar)
{
keyHit = true;
return -1;
}
}
else
else if (evt->m_vosEvent.m_eventType == GpVOSEventTypes::kMouseInput)
{
if (houseCursorIs != kArrowCursor)
const GpMouseInputEvent &mouseEvt = evt->m_vosEvent.m_event.m_mouseInputEvent;
if (mouseEvt.m_eventType == GpMouseEventTypes::kMove)
{
InitCursor();
houseCursorIs = kArrowCursor;
mouseIs = Point::Create(mouseEvt.m_x, mouseEvt.m_y);
mouseIs -= dial->GetWindow()->TopLeftCoord();
if ((houseEditText1.Contains(mouseIs)) ||
(houseEditText2.Contains(mouseIs)))
{
if (houseCursorIs != kBeamCursor)
{
PortabilityLayer::HostDisplayDriver::GetInstance()->SetStandardCursor(EGpStandardCursors::kIBeam);
houseCursorIs = kBeamCursor;
}
}
else
{
if (houseCursorIs != kArrowCursor)
{
InitCursor();
houseCursorIs = kArrowCursor;
}
}
}
}
return(false);
break;
}
return -1;
}
//-------------------------------------------------------------- DoHouseInfo
@@ -231,9 +231,12 @@ void DoHouseInfo (void)
houseInfoDialog = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kHouseInfoDialogID, kPutInFront, &substitutions);
if (houseInfoDialog == nil)
RedAlert(kErrDialogDidntLoad);
SetPort((GrafPtr)houseInfoDialog);
SetPort(&houseInfoDialog->GetWindow()->GetDrawSurface()->m_port);
ShowWindow(houseInfoDialog->GetWindow());
static_cast<PortabilityLayer::EditboxWidget*>(houseInfoDialog->GetItems()[kBannerTextItem - 1].GetWidget())->SetMultiLine(true);
static_cast<PortabilityLayer::EditboxWidget*>(houseInfoDialog->GetItems()[kTrailerTextItem - 1].GetWidget())->SetMultiLine(true);
SetDialogString(houseInfoDialog, kBannerTextItem, banner);
SetDialogString(houseInfoDialog, kTrailerTextItem, trailer);
SelectDialogItemText(houseInfoDialog, kBannerTextItem, 0, 1024);
@@ -241,10 +244,12 @@ void DoHouseInfo (void)
GetDialogItemRect(houseInfoDialog, kTrailerTextItem, &houseEditText2);
houseCursorIs = kArrowCursor;
leaving = false;
UpdateHouseInfoDialog(houseInfoDialog);
while (!leaving)
{
ModalDialog(HouseFilter, &item);
item = houseInfoDialog->ExecuteModal(HouseFilter);
if (item == kOkayButton)
{

View File

@@ -648,8 +648,8 @@ void CheckDuplicateFloorSuite (void)
{
bitPlace = (((*thisHouse)->rooms[i].floor + 7) * 128) +
(*thisHouse)->rooms[i].suite;
if ((bitPlace < 0) || (bitPlace >= 8192))
DebugStr(PSTR("Blew array"));
//if ((bitPlace < 0) || (bitPlace >= 8192))
// DebugStr(PSTR("Blew array"));
if (pidgeonHoles[bitPlace] != 0)
{
houseErrors++;

View File

@@ -12,6 +12,7 @@
#include "Externs.h"
#include "InputManager.h"
#include "MainWindow.h"
#include "QDPixMap.h"
#include "RectUtils.h"

View File

@@ -8,6 +8,8 @@
#include "Externs.h"
#include "Environ.h"
#include "HostDisplayDriver.h"
#include "IGpDisplayDriver.h"
#include "Map.h"
#include "MenuManager.h"
#include "PLKeyEncoding.h"
@@ -20,17 +22,14 @@
#define kHoriCursorID 130
#define kDiagCursorID 131
struct IGpCursor;
extern THandle<Rect> mirrorRects;
extern WindowPtr mapWindow, toolsWindow, linkWindow;
extern WindowPtr menuWindow;
extern Rect shieldRect, boardSrcRect, localRoomsDest[];
extern CursHandle handCursorH, vertCursorH, horiCursorH;
extern CursHandle diagCursorH;
extern Cursor handCursor, vertCursor, horiCursor;
extern Cursor diagCursor;
extern Rect boardSrcRect, localRoomsDest[];
extern IGpCursor *handCursor, *vertCursor, *horiCursor;
extern IGpCursor *diagCursor;
extern MenuHandle appleMenu, gameMenu, optionsMenu, houseMenu;
extern Point shieldPt;
extern long incrementModeTime;
extern UInt32 doubleTime;
extern short fadeInSequence[], idleMode;
@@ -81,25 +80,55 @@ void InitializeMenus (void)
void GetExtraCursors (void)
{
handCursorH = GetCursor(kHandCursorID);
if (handCursorH == nil)
handCursor = PortabilityLayer::HostDisplayDriver::GetInstance()->LoadCursor(false, kHandCursorID);
if (handCursor == nil)
RedAlert(kErrFailedResourceLoad);
handCursor = **handCursorH;
vertCursorH = GetCursor(kVertCursorID);
if (vertCursorH == nil)
vertCursor = PortabilityLayer::HostDisplayDriver::GetInstance()->LoadCursor(false, kVertCursorID);
if (vertCursor == nil)
RedAlert(kErrFailedResourceLoad);
vertCursor = **vertCursorH;
horiCursorH = GetCursor(kHoriCursorID);
if (horiCursorH == nil)
horiCursor = PortabilityLayer::HostDisplayDriver::GetInstance()->LoadCursor(false, kHoriCursorID);
if (horiCursor == nil)
RedAlert(kErrFailedResourceLoad);
horiCursor = **horiCursorH;
diagCursorH = GetCursor(kDiagCursorID);
if (diagCursorH == nil)
diagCursor = PortabilityLayer::HostDisplayDriver::GetInstance()->LoadCursor(false, kDiagCursorID);
if (diagCursor == nil)
RedAlert(kErrFailedResourceLoad);
diagCursor = **diagCursorH;
}
//-------------------------------------------------------------- RecomputeScreenRects
void RecomputeInterfaceRects (void)
{
houseRect = thisMac.constrainedScreen;
houseRect.bottom -= kScoreboardTall;
if (houseRect.right > kMaxViewWidth)
houseRect.right = kMaxViewWidth;
if (houseRect.bottom > kMaxViewHeight)
houseRect.bottom = kMaxViewHeight;
// NOTE: This is actually buggy, since the visible area is houseRect, not screen.
// We preserve the buggy behavior for authenticity unless the window is very tall.
short poHeight = RectTall(&thisMac.constrainedScreen);
if (poHeight > kMaxViewHeight - kScoreboardTall)
poHeight = kMaxViewHeight - kScoreboardTall;
playOriginH = (RectWide(&thisMac.constrainedScreen) - kRoomWide) / 2;
playOriginV = (poHeight - kTileHigh) / 2;
for (int i = 0; i < 9; i++)
{
QSetRect(&localRoomsDest[i], 0, 0, kRoomWide, kTileHigh);
QOffsetRect(&localRoomsDest[i], playOriginH, playOriginV);
}
QOffsetRect(&localRoomsDest[kNorthRoom], 0, -kVertLocalOffset);
QOffsetRect(&localRoomsDest[kNorthEastRoom], kRoomWide, -kVertLocalOffset);
QOffsetRect(&localRoomsDest[kEastRoom], kRoomWide, 0);
QOffsetRect(&localRoomsDest[kSouthEastRoom], kRoomWide, kVertLocalOffset);
QOffsetRect(&localRoomsDest[kSouthRoom], 0, kVertLocalOffset);
QOffsetRect(&localRoomsDest[kSouthWestRoom], -kRoomWide, kVertLocalOffset);
QOffsetRect(&localRoomsDest[kWestRoom], -kRoomWide, 0);
QOffsetRect(&localRoomsDest[kNorthWestRoom], -kRoomWide, -kVertLocalOffset);
}
//-------------------------------------------------------------- VariableInit
@@ -111,10 +140,6 @@ void VariableInit (void)
{
short i;
shieldPt.h = 0;
shieldPt.v = 0;
shieldRect = thisMac.screen;
menusUp = false;
quitting = false;
houseOpen = false;
@@ -176,7 +201,7 @@ void VariableInit (void)
fadeInSequence[14] = 9;
fadeInSequence[15] = 10;
doubleTime = GetDblTime();
doubleTime = 30; // PL_NotYetImplemented_TODO: Get this from the system settings
mirrorRects = nil;
mainWindow = nil;
@@ -187,30 +212,6 @@ void VariableInit (void)
coordWindow = nil;
toolSrcMap = nil;
nailSrcMap = nil;
menuWindow = nil;
houseRect = thisMac.screen;
houseRect.bottom -= kScoreboardTall;
if (houseRect.right > kMaxViewWidth)
houseRect.right = kMaxViewWidth;
if (houseRect.bottom > kMaxViewHeight)
houseRect.bottom = kMaxViewHeight;
playOriginH = (RectWide(&thisMac.screen) - kRoomWide) / 2;
playOriginV = (RectTall(&thisMac.screen) - kTileHigh) / 2;
for (i = 0; i < 9; i++)
{
QSetRect(&localRoomsDest[i], 0, 0, kRoomWide, kTileHigh);
QOffsetRect(&localRoomsDest[i], playOriginH, playOriginV);
}
QOffsetRect(&localRoomsDest[kNorthRoom], 0, -kVertLocalOffset);
QOffsetRect(&localRoomsDest[kNorthEastRoom], kRoomWide, -kVertLocalOffset);
QOffsetRect(&localRoomsDest[kEastRoom], kRoomWide, 0);
QOffsetRect(&localRoomsDest[kSouthEastRoom], kRoomWide, kVertLocalOffset);
QOffsetRect(&localRoomsDest[kSouthRoom], 0, kVertLocalOffset);
QOffsetRect(&localRoomsDest[kSouthWestRoom], -kRoomWide, kVertLocalOffset);
QOffsetRect(&localRoomsDest[kWestRoom], -kRoomWide, 0);
QOffsetRect(&localRoomsDest[kNorthWestRoom], -kRoomWide, -kVertLocalOffset);
RecomputeInterfaceRects();
}

View File

@@ -66,9 +66,9 @@ void UpdateLinkControl (void)
switch (linkType)
{
case kSwitchLinkOnly:
case kSwitchLinkOnly:
if (objActive == kNoObjectSelected)
HiliteControl(linkControl, kControlInactive);
linkControl->SetEnabled(false);// HiliteControl(linkControl, kControlInactive);
else
switch (thisRoom->objects[objActive].what)
{
@@ -119,18 +119,18 @@ void UpdateLinkControl (void)
case kBall:
case kDrip:
case kFish:
HiliteControl(linkControl, kControlActive);
linkControl->SetEnabled(true);
break;
default:
HiliteControl(linkControl, kControlInactive);
linkControl->SetEnabled(false);
break;
}
break;
case kTriggerLinkOnly:
if (objActive == kNoObjectSelected)
HiliteControl(linkControl, kControlInactive);
linkControl->SetEnabled(false);
else
switch (thisRoom->objects[objActive].what)
{
@@ -147,7 +147,7 @@ void UpdateLinkControl (void)
case kDartRt:
case kDrip:
case kFish:
HiliteControl(linkControl, kControlActive);
linkControl->SetEnabled(true);
break;
case kLightSwitch:
@@ -157,18 +157,18 @@ void UpdateLinkControl (void)
case kKnifeSwitch:
case kInvisSwitch:
if (linkRoom == thisRoomNumber)
HiliteControl(linkControl, kControlActive);
linkControl->SetEnabled(true);
break;
default:
HiliteControl(linkControl, kControlInactive);
linkControl->SetEnabled(false);
break;
}
break;
case kTransportLinkOnly:
if (objActive == kNoObjectSelected)
HiliteControl(linkControl, kControlInactive);
linkControl->SetEnabled(false);
else
switch (thisRoom->objects[objActive].what)
{
@@ -185,11 +185,11 @@ void UpdateLinkControl (void)
case kCalendar:
case kBulletin:
case kCloud:
HiliteControl(linkControl, kControlActive);
linkControl->SetEnabled(true);
break;
default:
HiliteControl(linkControl, kControlInactive);
linkControl->SetEnabled(false);
break;
}
break;
@@ -206,7 +206,6 @@ void UpdateLinkWindow (void)
return;
SetPortWindowPort(linkWindow);
DrawControls(linkWindow);
UpdateLinkControl();
#endif
}
@@ -218,26 +217,27 @@ void OpenLinkWindow (void)
#ifndef COMPILEDEMO
Rect src, dest;
Point globalMouse;
PortabilityLayer::WindowManager *wm = PortabilityLayer::WindowManager::GetInstance();
if (linkWindow == nil)
{
const uint16_t windowStyle = PortabilityLayer::WindowStyleFlags::kTitleBar | PortabilityLayer::WindowStyleFlags::kMiniBar;
const uint16_t windowStyle = PortabilityLayer::WindowStyleFlags::kTitleBar | PortabilityLayer::WindowStyleFlags::kMiniBar | PortabilityLayer::WindowStyleFlags::kCloseBox;
QSetRect(&linkWindowRect, 0, 0, 129, 30);
if (thisMac.hasColor)
linkWindow = NewCWindow(nil, &linkWindowRect,
PSTR("Link"), false, windowStyle, kPutInFront, true, 0L);
else
linkWindow = NewWindow(nil, &linkWindowRect,
PSTR("Link"), false, windowStyle, kPutInFront, true, 0L);
{
PortabilityLayer::WindowDef wdef = PortabilityLayer::WindowDef::Create(linkWindowRect, windowStyle, true, 0, 0, PSTR("Link"));
linkWindow = wm->CreateWindow(wdef);
}
wm->PutWindowBehind(linkWindow, wm->GetPutInFrontSentinel());
MoveWindow(linkWindow, isLinkH, isLinkV, true);
GetWindowRect(linkWindow, &dest);
BringToFront(linkWindow);
PortabilityLayer::WindowManager::GetInstance()->ShowWindow(linkWindow);
// FlagWindowFloating(linkWindow); TEMP - use flaoting windows
HiliteAllWindows();
PortabilityLayer::WidgetBasicState basicState;
basicState.m_rect = Rect::Create(5, 70, 25, 124);
@@ -250,11 +250,15 @@ void OpenLinkWindow (void)
basicState.m_text.Set(6, "Unlink");
basicState.m_window = linkWindow;
unlinkControl = PortabilityLayer::ButtonWidget::Create(basicState);
linkWindow->DrawControls();
linkRoom = -1;
linkObject = 255;
isLinkOpen = true;
UpdateLinkWindow();
}
#endif
}
@@ -265,7 +269,7 @@ void CloseLinkWindow (void)
{
#ifndef COMPILEDEMO
if (linkWindow != nil)
DisposeWindow(linkWindow);
PortabilityLayer::WindowManager::GetInstance()->DestroyWindow(linkWindow);
linkWindow = nil;
isLinkOpen = false;
@@ -380,7 +384,7 @@ void HandleLinkClick (Point wherePt)
part = FindControl(wherePt, linkWindow, &theControl);
if ((theControl != nil) && (part != 0))
{
part = TrackControl(theControl, wherePt, nil);
part = theControl->Capture(wherePt, nullptr);
if (part != 0)
{
if (theControl == linkControl)

View File

@@ -204,7 +204,7 @@ void ReadInPrefs (void)
doBitchDialogs = true;
}
if ((numNeighbors > 1) && (thisMac.screen.right <= 512))
if ((numNeighbors > 1) && (thisMac.constrainedScreen.right <= 512))
numNeighbors = 1;
UnivGetSoundVolume(&wasVolume, thisMac.hasSM3);
@@ -315,6 +315,7 @@ int gpAppMain()
ToolBoxInit();
CheckOurEnvirons();
InstallResolutionHandler();
if (!thisMac.hasColor)
RedAlert(kErrNeedColorQD);
if (!thisMac.hasSystem7)
@@ -351,14 +352,6 @@ int gpAppMain()
InitSrcRects();
CreateOffscreens(); SpinCursor(2);
OpenMainWindow();
if (thisMac.hasQT)
{
theErr = EnterMovies();
if (theErr != PLErrors::kNone)
thisMac.hasQT = false;
}
InitSound(); SpinCursor(2);
InitMusic(); SpinCursor(2);
BuildHouseList();

View File

@@ -11,9 +11,12 @@
#include "Externs.h"
#include "Environ.h"
#include "FontFamily.h"
#include "HostDisplayDriver.h"
#include "House.h"
#include "IGpDisplayDriver.h"
#include "InputManager.h"
#include "MenuManager.h"
#include "QDPixMap.h"
#include "RectUtils.h"
#include "PLKeyEncoding.h"
#include "PLStandardColors.h"
@@ -35,14 +38,12 @@ CTabHandle theCTab;
PixMapHandle thePMap;
ColorSpec * wasColors;
ColorSpec * newColors;
CursHandle handCursorH, vertCursorH, horiCursorH;
CursHandle diagCursorH;
Cursor handCursor, vertCursor, horiCursor;
Cursor diagCursor;
IGpCursor *handCursor, *vertCursor, *horiCursor;
IGpCursor *diagCursor;
Rect workSrcRect;
DrawSurface *workSrcMap;
Rect mainWindowRect;
WindowPtr mainWindow, menuWindow, boardWindow;
WindowPtr mainWindow, boardWindow;
short isEditH, isEditV;
short playOriginH, playOriginV;
short splashOriginH, splashOriginV;
@@ -66,7 +67,7 @@ void DrawOnSplash(DrawSurface *surface)
PasStringCopy(PSTR("House: "), houseLoadedStr);
PasStringConcat(houseLoadedStr, thisHouseName);
if ((thisMac.hasQT) && (hasMovie))
PasStringConcat(houseLoadedStr, PSTR(" (QT)"));
PasStringConcat(houseLoadedStr, PSTR(" (TV)"));
surface->SetApplicationFont(9, PortabilityLayer::FontFamilyFlag_Bold);
@@ -166,22 +167,6 @@ void UpdateMainWindow (void)
splashDrawn = true;
}
//-------------------------------------------------------------- UpdateMenuBarWindow
// Ugly kludge to cover over the menu bar when playing game on 2nd monitor.
void UpdateMenuBarWindow (DrawSurface *surface)
{
Rect bounds;
if (menuWindow == nil)
return;
GetLocalWindowRect(menuWindow, &bounds);
surface->SetForeColor(StdColors::Black());
surface->FillRect(bounds);
}
//-------------------------------------------------------------- OpenMainWindow
// Opens up the main window (how it does this depends on mode were in).
@@ -198,10 +183,8 @@ void OpenMainWindow (void)
if (theMode == kEditMode)
{
if (menuWindow != nil)
PortabilityLayer::WindowManager::GetInstance()->DestroyWindow(menuWindow);
menuWindow = nil;
PortabilityLayer::HostDisplayDriver::GetInstance()->SetBackgroundColor(51, 51, 102, 255);
QSetRect(&mainWindowRect, 0, 0, 512, 322);
mainWindow = GetNewCWindow(kEditWindowID, nil, kPutInFront);
SizeWindow(mainWindow, mainWindowRect.right,
@@ -209,8 +192,8 @@ void OpenMainWindow (void)
if (OptionKeyDown())
{
isEditH = 3;
isEditV = 41;
isEditH = 10;
isEditV = 46;
}
MoveWindow(mainWindow, isEditH, isEditV, true);
ShowWindow(mainWindow);
@@ -227,36 +210,38 @@ void OpenMainWindow (void)
}
else
{
if (menuWindow == nil)
{
menuWindow = GetNewCWindow(kMenuWindowID, nil, kPutInFront);
SizeWindow(menuWindow, RectWide(&thisMac.screen), 20, false);
MoveWindow(menuWindow, thisMac.screen.left,
thisMac.screen.top, true);
ShowWindow(menuWindow);
}
#ifdef NDEBUG
PortabilityLayer::HostDisplayDriver::GetInstance()->SetBackgroundColor(0, 0, 0, 255);
#else
PortabilityLayer::HostDisplayDriver::GetInstance()->SetBackgroundColor(51, 0, 0, 255);
#endif
if (boardWindow == nil)
{
PortabilityLayer::WindowManager *windowManager = PortabilityLayer::WindowManager::GetInstance();
Rect scorebarRect = thisMac.screen;
Rect scorebarRect = thisMac.constrainedScreen;
scorebarRect.bottom = scorebarRect.top + kScoreboardTall;
PortabilityLayer::WindowDef windowDef = PortabilityLayer::WindowDef::Create(scorebarRect, PortabilityLayer::WindowStyleFlags::kBorderless, true, false, 0, 0, PSTR("Scoreboard"));
PortabilityLayer::WindowDef windowDef = PortabilityLayer::WindowDef::Create(scorebarRect, PortabilityLayer::WindowStyleFlags::kBorderless, true, 0, 0, PSTR("Scoreboard"));
boardWindow = windowManager->CreateWindow(windowDef);
if (boardWindow != nil)
windowManager->PutWindowBehind(boardWindow, PL_GetPutInFrontWindowPtr());
else
PL_NotYetImplemented_TODO("Errors");
}
mainWindowRect = thisMac.screen;
mainWindowRect = thisMac.constrainedScreen;
ZeroRectCorner(&mainWindowRect);
mainWindowRect.bottom -= 20; // thisMac.menuHigh
mainWindowRect.bottom -= kScoreboardTall; // thisMac.menuHigh
mainWindow = GetNewCWindow(kMainWindowID, nil, kPutInFront);
SizeWindow(mainWindow, mainWindowRect.right - mainWindowRect.left,
mainWindowRect.bottom - mainWindowRect.top, false);
MoveWindow(mainWindow, thisMac.screen.left,
thisMac.screen.top + 20, true); // thisMac.menuHigh
const short mainWindowLeft = (thisMac.fullScreen.left + thisMac.fullScreen.right + thisMac.constrainedScreen.left - thisMac.constrainedScreen.right) / 2;
const short mainWindowTop = (thisMac.fullScreen.top + thisMac.fullScreen.bottom + thisMac.constrainedScreen.top - thisMac.constrainedScreen.bottom) / 2 + kScoreboardTall;
MoveWindow(boardWindow, mainWindowLeft, 0, true);
MoveWindow(mainWindow, mainWindowLeft, mainWindowTop, true); // thisMac.menuHigh
ShowWindow(mainWindow);
SetPortWindowPort(mainWindow);
@@ -268,15 +253,14 @@ void OpenMainWindow (void)
mainWindowSurface->SetBackColor(StdColors::White());
mainWindowSurface->FillRect(mainWindowRect);
splashOriginH = ((thisMac.screen.right - thisMac.screen.left) - 640) / 2;
splashOriginH = ((thisMac.constrainedScreen.right - thisMac.constrainedScreen.left) - 640) / 2;
if (splashOriginH < 0)
splashOriginH = 0;
splashOriginV = ((thisMac.screen.bottom - thisMac.screen.top) - 480) / 2;
splashOriginV = ((thisMac.constrainedScreen.bottom - thisMac.constrainedScreen.top) - 480) / 2;
if (splashOriginV < 0)
splashOriginV = 0;
workSrcMap->FillRect(workSrcRect);
LoadGraphic(workSrcMap, kSplash8BitPICT);
// if ((fadeGraysOut) && (isDoColorFade))
// {
@@ -289,6 +273,7 @@ void OpenMainWindow (void)
// }
SetPortWindowPort(mainWindow);
UpdateMainWindow();
}
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
@@ -369,7 +354,8 @@ void UpdateEditWindowTitle (void)
}
else
PasStringConcat(newTitle, PSTR("House Locked"));
SetWTitle(mainWindow, newTitle);
PortabilityLayer::WindowManager::GetInstance()->SetWindowTitle(mainWindow, newTitle);
}
#endif
@@ -390,7 +376,7 @@ void HandleMainClick (Point wherePt, Boolean isDoubleClick)
DrawSurface *mainWindowSurface = mainWindow->GetDrawSurface();
if (toolSelected == kSelectTool)
DoSelectionClick(mainWindowSurface, wherePt, isDoubleClick);
DoSelectionClick(mainWindow, mainWindowSurface, wherePt, isDoubleClick);
else
DoNewObjectClick(wherePt);

View File

@@ -17,6 +17,7 @@
#include "PLWidgets.h"
#include "WindowDef.h"
#include "WindowManager.h"
#include "QDPixMap.h"
#include "RectUtils.h"
#include "Utilities.h"
@@ -111,8 +112,7 @@ void FlagMapRoomsForUpdate (void)
return;
// SetPortWindowPort(mapWindow);
InvalWindowRect(mapWindow, &wasActiveRoomRect);
InvalWindowRect(mapWindow, &activeRoomRect);
UpdateMapWindow();
}
#endif
@@ -248,13 +248,16 @@ void RedrawMapContents (void)
}
else
{
surface->SetForeColor(StdColors::White());
surface->FillRect(aRoom);
if (i >= groundLevel)
surface->SetForeColor(StdColors::Green());
else
surface->SetForeColor(StdColors::Blue());
Pattern dummyPat;
surface->FillRectWithPattern8x8(aRoom, *GetQDGlobalsGray(&dummyPat));
surface->FillRectWithPattern8x8(aRoom, true, *GetQDGlobalsGray(&dummyPat));
}
}
}
@@ -327,24 +330,24 @@ void ResizeMapWindow (short newH, short newV)
if (mapRoomsHigh < 3)
mapRoomsHigh = 3;
QSetRect(&mapWindowRect, 0, 0,
mapRoomsWide * kMapRoomWidth + kMapScrollBarWidth - 2,
mapRoomsHigh * kMapRoomHeight + kMapScrollBarWidth - 2);
mapRoomsWide * kMapRoomWidth + kMapScrollBarWidth - 1,
mapRoomsHigh * kMapRoomHeight + kMapScrollBarWidth - 1);
surface->SetForeColor(StdColors::White());
surface->FillRect(mapWindowRect);
SizeWindow(mapWindow, mapWindowRect.right, mapWindowRect.bottom, true);
mapHScroll->SetMax(kMaxNumRoomsH - mapRoomsWide);
mapHScroll->SetPosition(Point::Create(0, mapWindowRect.bottom - kMapScrollBarWidth + 2));
mapHScroll->SetPosition(Point::Create(0, mapWindowRect.bottom - kMapScrollBarWidth + 1));
mapHScroll->Resize(mapWindowRect.right - kMapScrollBarWidth + 3, kMapScrollBarWidth);
mapLeftRoom = mapHScroll->GetState();
mapVScroll->SetMax(kMaxNumRoomsV - mapRoomsHigh);
mapVScroll->SetPosition(Point::Create(mapWindowRect.right - kMapScrollBarWidth + 2, 0));
mapVScroll->SetPosition(Point::Create(mapWindowRect.right - kMapScrollBarWidth + 1, 0));
mapVScroll->Resize(kMapScrollBarWidth, mapWindowRect.bottom - kMapScrollBarWidth + 3);
mapTopRoom = mapVScroll->GetState();
InvalWindowRect(mapWindow, &mapWindowRect);
UpdateMapWindow();
#endif
}
@@ -359,12 +362,12 @@ void OpenMapWindow (void)
{
CreateNailOffscreen();
QSetRect(&mapWindowRect, 0, 0,
mapRoomsWide * kMapRoomWidth + kMapScrollBarWidth - 2,
mapRoomsHigh * kMapRoomHeight + kMapScrollBarWidth - 2);
mapRoomsWide * kMapRoomWidth + kMapScrollBarWidth - 1,
mapRoomsHigh * kMapRoomHeight + kMapScrollBarWidth - 1);
const uint16_t windowStyle = PortabilityLayer::WindowStyleFlags::kTitleBar | PortabilityLayer::WindowStyleFlags::kResizable | PortabilityLayer::WindowStyleFlags::kMiniBar;
const uint16_t windowStyle = PortabilityLayer::WindowStyleFlags::kTitleBar | PortabilityLayer::WindowStyleFlags::kResizable | PortabilityLayer::WindowStyleFlags::kMiniBar | PortabilityLayer::WindowStyleFlags::kCloseBox;;
PortabilityLayer::WindowDef wdef = PortabilityLayer::WindowDef::Create(mapWindowRect, windowStyle, false, true, 0, 0, PSTR("Map"));
PortabilityLayer::WindowDef wdef = PortabilityLayer::WindowDef::Create(mapWindowRect, windowStyle, false, 0, 0, PSTR("Map"));
mapWindow = PortabilityLayer::WindowManager::GetInstance()->CreateWindow(wdef);
@@ -386,7 +389,7 @@ void OpenMapWindow (void)
PortabilityLayer::WindowManager::GetInstance()->ShowWindow(mapWindow);
// FlagWindowFloating(mapWindow); TEMP - use flaoting windows
SetPort((GrafPtr)mapWindow);
SetPort(&mapWindow->GetDrawSurface()->m_port);
QSetRect(&mapHScrollRect, -1, mapRoomsHigh * kMapRoomHeight,
mapRoomsWide * kMapRoomWidth + 1,
mapRoomsHigh * kMapRoomHeight + kMapScrollBarWidth);
@@ -425,6 +428,8 @@ void OpenMapWindow (void)
mapWindowRect.bottom + 2);
CenterMapOnRoom(thisRoom->suite, thisRoom->floor);
UpdateMapWindow();
}
UpdateMapCheckmark(true);
@@ -462,50 +467,50 @@ void ToggleMapWindow (void)
//-------------------------------------------------------------- LiveHScrollAction
#ifndef COMPILEDEMO
void LiveHScrollAction (ControlHandle theControl, short thePart)
void LiveHScrollAction (PortabilityLayer::Widget *theControl, int thePart)
{
short wasValue, newValue;
switch (thePart)
{
case kControlUpButtonPart:
wasValue = GetControlValue(theControl);
SetControlValue(theControl, wasValue - 1);
if (GetControlValue(theControl) != wasValue)
wasValue = theControl->GetState();
theControl->SetState(wasValue - 1);
if (theControl->GetState() != wasValue)
{
mapLeftRoom = GetControlValue(theControl);
mapLeftRoom = theControl->GetState();
RedrawMapContents();
}
break;
case kControlDownButtonPart:
wasValue = GetControlValue(theControl);
SetControlValue(theControl, wasValue + 1);
if (GetControlValue(theControl) != wasValue)
wasValue = theControl->GetState();
theControl->SetState(wasValue + 1);
if (theControl->GetState() != wasValue)
{
mapLeftRoom = GetControlValue(theControl);
mapLeftRoom = theControl->GetState();
RedrawMapContents();
}
break;
case kControlPageUpPart:
wasValue = GetControlValue(theControl);
wasValue = theControl->GetState();
newValue = wasValue - (mapRoomsWide / 2);
SetControlValue(theControl, newValue);
if (GetControlValue(theControl) != wasValue)
theControl->SetState(newValue);
if (theControl->GetState() != wasValue)
{
mapLeftRoom = GetControlValue(theControl);
mapLeftRoom = theControl->GetState();
RedrawMapContents();
}
break;
case kControlPageDownPart:
wasValue = GetControlValue(theControl);
wasValue = theControl->GetState();
newValue = wasValue + (mapRoomsWide / 2);
SetControlValue(theControl, newValue);
if (GetControlValue(theControl) != wasValue)
theControl->SetState(newValue);
if (theControl->GetState() != wasValue)
{
mapLeftRoom = GetControlValue(theControl);
mapLeftRoom = theControl->GetState();
RedrawMapContents();
}
break;
@@ -519,50 +524,50 @@ void LiveHScrollAction (ControlHandle theControl, short thePart)
//-------------------------------------------------------------- LiveVScrollAction
#ifndef COMPILEDEMO
void LiveVScrollAction (ControlHandle theControl, short thePart)
void LiveVScrollAction (PortabilityLayer::Widget *theControl, int thePart)
{
short wasValue, newValue;
switch (thePart)
{
case kControlUpButtonPart:
wasValue = GetControlValue(theControl);
SetControlValue(theControl, wasValue - 1);
if (GetControlValue(theControl) != wasValue)
wasValue = theControl->GetState();
theControl->SetState(wasValue - 1);
if (theControl->GetState() != wasValue)
{
mapTopRoom = GetControlValue(theControl);
mapTopRoom = theControl->GetState();
RedrawMapContents();
}
break;
case kControlDownButtonPart:
wasValue = GetControlValue(theControl);
SetControlValue(theControl, wasValue + 1);
if (GetControlValue(theControl) != wasValue)
wasValue = theControl->GetState();
theControl->SetState(wasValue + 1);
if (theControl->GetState() != wasValue)
{
mapTopRoom = GetControlValue(theControl);
mapTopRoom = theControl->GetState();
RedrawMapContents();
}
break;
case kControlPageUpPart:
wasValue = GetControlValue(theControl);
wasValue = theControl->GetState();
newValue = wasValue - (mapRoomsHigh / 2);
SetControlValue(theControl, newValue);
if (GetControlValue(theControl) != wasValue)
theControl->SetState(newValue);
if (theControl->GetState() != wasValue)
{
mapTopRoom = GetControlValue(theControl);
mapTopRoom = theControl->GetState();
RedrawMapContents();
}
break;
case kControlPageDownPart:
wasValue = GetControlValue(theControl);
wasValue = theControl->GetState();
newValue = wasValue + (mapRoomsHigh / 2);
SetControlValue(theControl, newValue);
if (GetControlValue(theControl) != wasValue)
theControl->SetState(newValue);
if (theControl->GetState() != wasValue)
{
mapTopRoom = GetControlValue(theControl);
mapTopRoom = theControl->GetState();
RedrawMapContents();
}
break;
@@ -579,18 +584,14 @@ void HandleMapClick (const GpMouseInputEvent &theEvent)
{
#ifndef COMPILEDEMO
Rect aRoom;
ControlHandle whichControl;
PortabilityLayer::Widget *whichControl = nullptr;
Point wherePt, globalWhere;
long controlRef;
short whichPart, localH, localV;
short roomH, roomV, itsNumber;
ControlActionUPP scrollHActionUPP, scrollVActionUPP;
wherePt = Point::Create(theEvent.m_x, theEvent.m_y);
scrollHActionUPP = NewControlActionUPP(LiveHScrollAction);
scrollVActionUPP = NewControlActionUPP(LiveVScrollAction);
if (mapWindow == nil)
return;
@@ -665,7 +666,7 @@ void HandleMapClick (const GpMouseInputEvent &theEvent)
}
else
{
controlRef = GetControlReference(whichControl);
controlRef = whichControl->GetReferenceConstant();
if (controlRef == kHScrollRef)
{
switch (whichPart)
@@ -674,16 +675,13 @@ void HandleMapClick (const GpMouseInputEvent &theEvent)
case kControlDownButtonPart:
case kControlPageUpPart:
case kControlPageDownPart:
if (TrackControl(whichControl, wherePt, scrollHActionUPP))
{
}
whichControl->Capture(wherePt, LiveHScrollAction);
break;
case kControlIndicatorPart:
if (TrackControl(whichControl, wherePt, nil))
if (whichControl->Capture(wherePt, nil))
{
mapLeftRoom = GetControlValue(whichControl);
mapLeftRoom = whichControl->GetState();
RedrawMapContents();
}
break;
@@ -697,25 +695,19 @@ void HandleMapClick (const GpMouseInputEvent &theEvent)
case kControlDownButtonPart:
case kControlPageUpPart:
case kControlPageDownPart:
if (TrackControl(whichControl, wherePt, scrollVActionUPP))
{
}
whichControl->Capture(wherePt, LiveVScrollAction);
break;
case kControlIndicatorPart:
if (TrackControl(whichControl, wherePt, nil))
if (whichControl->Capture(wherePt, nil))
{
mapTopRoom = GetControlValue(whichControl);
mapTopRoom = whichControl->GetState();
RedrawMapContents();
}
break;
}
}
}
DisposeControlActionUPP(scrollHActionUPP);
DisposeControlActionUPP(scrollVActionUPP);
#endif
}

View File

@@ -6,11 +6,17 @@
#include "Externs.h"
#include "HostDisplayDriver.h"
#include "IGpDisplayDriver.h"
#include "InputManager.h"
#include "Marquee.h"
#include "Objects.h"
#include "ObjectEdit.h"
#include "RectUtils.h"
#include <assert.h>
#include <algorithm>
#define kMarqueePatListID 128
#define kHandleSideLong 9
@@ -25,7 +31,7 @@ Rect marqueeGliderRect;
Boolean gliderMarqueeUp;
extern Cursor handCursor, vertCursor, horiCursor, diagCursor;
extern IGpCursor *handCursor, *vertCursor, *horiCursor, *diagCursor;
extern Rect leftStartGliderSrc;
@@ -182,7 +188,7 @@ void ResumeMarquee (void)
//-------------------------------------------------------------- DragOutMarqueeRect
void DragOutMarqueeRect (Point start, Rect *theRect)
void DragOutMarqueeRect (Window *window, Point start, Rect *theRect)
{
Point wasPt, newPt;
DrawSurface *surface = mainWindow->GetDrawSurface();
@@ -196,8 +202,8 @@ void DragOutMarqueeRect (Point start, Rect *theRect)
while (WaitMouseUp())
{
GetMouse(&newPt);
if (DeltaPoint(wasPt, newPt))
GetMouse(window, &newPt);
if (wasPt != newPt)
{
surface->InvertFrameRect(*theRect, pattern);
QSetRect(theRect, start.h, start.v, newPt.h, newPt.v);
@@ -211,12 +217,12 @@ void DragOutMarqueeRect (Point start, Rect *theRect)
//-------------------------------------------------------------- DragMarqueeRect
void DragMarqueeRect (DrawSurface *surface, Point start, Rect *theRect, Boolean lockH, Boolean lockV)
void DragMarqueeRect (Window *window, DrawSurface *surface, Point start, Rect *theRect, Boolean lockH, Boolean lockV)
{
Point wasPt, newPt;
short deltaH, deltaV;
SetCursor(&handCursor);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetCursor(handCursor);
StopMarquee();
const uint8_t *pattern = theMarquee.pats[theMarquee.index];
@@ -226,8 +232,8 @@ void DragMarqueeRect (DrawSurface *surface, Point start, Rect *theRect, Boolean
wasPt = start;
while (WaitMouseUp())
{
GetMouse(&newPt);
if (DeltaPoint(wasPt, newPt))
GetMouse(window, &newPt);
if (wasPt != newPt)
{
if (lockV)
deltaH = 0;
@@ -253,15 +259,15 @@ void DragMarqueeRect (DrawSurface *surface, Point start, Rect *theRect, Boolean
//-------------------------------------------------------------- DragMarqueeHandle
void DragMarqueeHandle (DrawSurface *surface, Point start, short *dragged)
void DragMarqueeHandle (Window *window, DrawSurface *surface, Point start, short *dragged)
{
Point wasPt, newPt;
short deltaH, deltaV;
if ((theMarquee.direction == kAbove) || (theMarquee.direction == kBelow))
SetCursor(&vertCursor);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetCursor(vertCursor);
else
SetCursor(&horiCursor);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetCursor(horiCursor);
StopMarquee();
const uint8_t *pattern = theMarquee.pats[theMarquee.index];
@@ -271,8 +277,8 @@ void DragMarqueeHandle (DrawSurface *surface, Point start, short *dragged)
wasPt = start;
while (WaitMouseUp())
{
GetMouse(&newPt);
if (DeltaPoint(wasPt, newPt))
GetMouse(window, &newPt);
if (wasPt != newPt)
{
switch (theMarquee.direction)
{
@@ -333,18 +339,17 @@ void DragMarqueeHandle (DrawSurface *surface, Point start, short *dragged)
}
surface->InvertFrameRect(theMarquee.bounds, pattern);
surface->InvertFillRect(theMarquee.handle, pattern);
PenNormal();
InitCursor();
}
//-------------------------------------------------------------- DragMarqueeCorner
void DragMarqueeCorner (DrawSurface *surface, Point start, short *hDragged, short *vDragged, Boolean isTop)
void DragMarqueeCorner (Window *window, DrawSurface *surface, Point start, short *hDragged, short *vDragged, Boolean isTop)
{
Point wasPt, newPt;
short deltaH, deltaV;
SetCursor(&diagCursor);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetCursor(diagCursor);
StopMarquee();
const uint8_t *pattern = theMarquee.pats[theMarquee.index];
@@ -354,8 +359,8 @@ void DragMarqueeCorner (DrawSurface *surface, Point start, short *hDragged, shor
wasPt = start;
while (WaitMouseUp())
{
GetMouse(&newPt);
if (DeltaPoint(wasPt, newPt))
GetMouse(window, &newPt);
if (wasPt != newPt)
{
deltaH = newPt.h - wasPt.h;
if (isTop)
@@ -395,7 +400,6 @@ void DragMarqueeCorner (DrawSurface *surface, Point start, short *hDragged, shor
}
surface->InvertFrameRect(theMarquee.bounds, pattern);
surface->InvertFillRect(theMarquee.handle, pattern);
PenNormal();
InitCursor();
}
@@ -421,18 +425,16 @@ Boolean MarqueeHasHandles (short *direction, short *dist)
Boolean PtInMarqueeHandle (Point where)
{
return (PtInRect(where, &theMarquee.handle));
return theMarquee.handle.Contains(where);
}
//-------------------------------------------------------------- DrawGliderMarquee
void DrawGliderMarquee (void)
{
CopyBits((BitMap *)*GetGWorldPixMap(blowerMaskMap),
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
&leftStartGliderSrc,
&marqueeGliderRect,
srcXor);
DrawSurface *surface = GetWindowPort(mainWindow);
ImageInvert(*GetGWorldPixMap(blowerMaskMap), GetPortBitMapForCopyBits(surface), leftStartGliderSrc, marqueeGliderRect);
surface->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
}
//-------------------------------------------------------------- SetMarqueeGliderCenter
@@ -488,7 +490,12 @@ void DrawMarquee (DrawSurface *surface, const uint8_t *pattern)
break;
}
surface->InvertDrawLine(points[0], points[1], pattern);
if (points[1].h < points[0].h)
std::swap(points[0].h, points[1].h);
if (points[1].v < points[0].v)
std::swap(points[0].v, points[1].v);
surface->InvertFillRect(Rect::Create(points[0].v, points[0].h, points[1].v + 1, points[1].h + 1), pattern);
}
if (gliderMarqueeUp)

View File

@@ -29,9 +29,6 @@ void UpdateMenusEditMode (void);
void UpdateMenusNonEditMode (void);
void UpdateMenusHouseOpen (void);
void UpdateMenusHouseClosed (void);
void UpdateResumeDialog (Dialog *);
Boolean ResumeFilter (Dialog *, EventRecord *, short *);
short QueryResumeGame (void);
void HeyYourPissingAHighScore (void);
@@ -187,7 +184,7 @@ void UpdateClipboardMenus (void)
mm->SetItemText(houseMenu, iCopy - 1, title);
GetLocalizedString(38, title);
mm->SetItemText(houseMenu, iClear - 1, title);
mm->SetItemEnabled(houseMenu, iDuplicate - 1, false);
mm->SetItemEnabled(houseMenu, iDuplicate - 1, true);
}
else
{
@@ -666,106 +663,6 @@ void UpdateCoordinateCheckmark (Boolean checkIt)
CheckMenuItem(houseMenu, iCoordinateWindow, checkIt);
}
//-------------------------------------------------------------- UpdateResumeDialog
// Update function for Resume dialog (below).
void UpdateResumeDialog (Dialog *theDialog)
{
DrawDialog(theDialog);
DrawDefaultButton(theDialog);
}
//-------------------------------------------------------------- ResumeFilter
// Dialog filter for the Resume dialog (below).
Boolean ResumeFilter (Dialog *dial, EventRecord *event, short *item)
{
switch (event->what)
{
case keyDown:
switch (event->message)
{
case PL_KEY_SPECIAL(kEnter):
case PL_KEY_NUMPAD_SPECIAL(kEnter):
FlashDialogButton(dial, kOkayButton);
*item = kOkayButton;
return(true);
break;
default:
return(false);
}
break;
case updateEvt:
if ((WindowPtr)event->message == dial->GetWindow())
{
SetPortDialogPort(dial);
UpdateResumeDialog(dial);
EndUpdate(dial->GetWindow());
event->what = nullEvent;
}
return(false);
break;
default:
return(false);
break;
}
}
//-------------------------------------------------------------- QueryResumeGame
// Dialog that asks user whether they want to resume a saved game orÉ
// begin a new one. It displays a little info on the state of theirÉ
// saved game (number of glider left, points, etc.).
short QueryResumeGame (void)
{
#define kResumeGameDial 1025
Dialog *theDial;
houseType *thisHousePtr;
Str255 scoreStr, glidStr;
long hadPoints;
short hitWhat, hadGliders;
char wasState;
Boolean leaving;
// get score & num. gliders
thisHousePtr = *thisHouse;
hadPoints = thisHousePtr->savedGame.score;
hadGliders = thisHousePtr->savedGame.numGliders;
NumToString(hadPoints, scoreStr); // param text strings
NumToString((long)hadGliders, glidStr);
DialogTextSubstitutions substitutions;
if (hadGliders == 1)
substitutions = DialogTextSubstitutions(glidStr, PSTR(""), scoreStr);
else
substitutions = DialogTextSubstitutions(glidStr, PSTR("s"), scoreStr);
// CenterDialog(kResumeGameDial);
theDial = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kResumeGameDial, kPutInFront, &substitutions);
if (theDial == nil)
RedAlert(kErrDialogDidntLoad);
SetPort((GrafPtr)theDial);
ShowWindow(theDial->GetWindow());
DrawDefaultButton(theDial);
leaving = false;
while (!leaving)
{
ModalDialog(ResumeFilter, &hitWhat);
if ((hitWhat == kSheWantsNewGame) || (hitWhat == kSheWantsResumeGame))
{
leaving = true;
}
}
theDial->Destroy();
return (hitWhat);
}
//-------------------------------------------------------------- DoNotInDemo
// Only compiled for "demo version" of Glider PRO. It brings up aÉ
// dialog that says, essentially, "x" feature is not implemented inÉ

View File

@@ -222,7 +222,7 @@ PLError_t LoadMusicSounds (void)
if (theMusicData[i] == nil)
return PLErrors::kOutOfMemory;
BlockMove(static_cast<Byte*>(*theSound), theMusicData[i], soundDataSize);
memcpy(theMusicData[i], static_cast<Byte*>(*theSound), soundDataSize);
theSound.Dispose();
}
return (theErr);

View File

@@ -789,7 +789,7 @@ Boolean AddNewObject (Point where, short what, Boolean showItNow)
ReadyBackground(thisRoom->background, thisRoom->tiles);
GetThisRoomsObjRects();
DrawThisRoomsObjects();
InvalWindowRect(mainWindow, &mainWindowRect);
UpdateMainWindow();
if (handled)
{

View File

@@ -161,15 +161,12 @@ void DrawTable (Rect *tableTop, short down)
-HalfRectTall(&tempRect) + kTableShadowTop + down);
QOffsetRect(&tempRect, kTableShadowOffset, -kTableShadowOffset);
backSrcMap->SetPattern8x8(*GetQDGlobalsGray(&dummyPattern));
backSrcMap->SetMaskMode(true);
GetQDGlobalsGray(&dummyPattern);
if (thisMac.isDepth == 4)
ColorOval(backSrcMap, tempRect, 15);
ColorOvalMaskPattern(backSrcMap, tempRect, 15, true, dummyPattern);
else
ColorOval(backSrcMap, tempRect, k8DkstGrayColor);
backSrcMap->ClearPattern();
backSrcMap->SetMaskMode(false);
ColorOvalMaskPattern(backSrcMap, tempRect, k8DkstGrayColor, true, dummyPattern);
InsetRect(tableTop, 0, 1);
ColorRect(backSrcMap, *tableTop, brownC);
@@ -280,14 +277,11 @@ void DrawShelf (Rect *shelfTop)
if (mask)
{
backSrcMap->SetPattern8x8(*GetQDGlobalsGray(&dummyPattern));
backSrcMap->SetMaskMode(true);
GetQDGlobalsGray(&dummyPattern);
if (thisMac.isDepth == 4)
ColorRegion(backSrcMap, mask, 15);
ColorRegionMaskPattern(backSrcMap, mask, 15, true, dummyPattern);
else
ColorRegion(backSrcMap, mask, k8DkstGrayColor);
backSrcMap->ClearPattern();
backSrcMap->SetMaskMode(false);
ColorRegionMaskPattern(backSrcMap, mask, k8DkstGrayColor, true, dummyPattern);
mask->Destroy();
}
@@ -371,14 +365,11 @@ void DrawCabinet (Rect *cabinet)
if (mask)
{
backSrcMap->SetPattern8x8(*GetQDGlobalsGray(&dummyPattern));
backSrcMap->SetMaskMode(true);
GetQDGlobalsGray(&dummyPattern);
if (thisMac.isDepth == 4)
ColorRegion(backSrcMap, mask, 15);
ColorRegionMaskPattern(backSrcMap, mask, 15, true, dummyPattern);
else
ColorRegion(backSrcMap, mask, dkGrayC);
backSrcMap->ClearPattern();
backSrcMap->SetMaskMode(false);
ColorRegionMaskPattern(backSrcMap, mask, dkGrayC, true, dummyPattern);
mask->Destroy();
}
@@ -511,14 +502,11 @@ void DrawCounter(Rect *counter)
if (mask)
{
backSrcMap->SetPattern8x8(*GetQDGlobalsGray(&dummyPattern));
backSrcMap->SetMaskMode(true);
GetQDGlobalsGray(&dummyPattern);
if (thisMac.isDepth == 4)
ColorRegion(backSrcMap, mask, 15);
ColorRegionMaskPattern(backSrcMap, mask, 15, true, dummyPattern);
else
ColorRegion(backSrcMap, mask, dkGrayC);
backSrcMap->ClearPattern();
backSrcMap->SetMaskMode(false);
ColorRegionMaskPattern(backSrcMap, mask, dkGrayC, true, dummyPattern);
mask->Destroy();
}
@@ -758,10 +746,8 @@ void DrawDeckTable (Rect *tableTop, short down)
QOffsetRect(&tempRect, 0,
-HalfRectTall(&tempRect) + kTableShadowTop + down);
QOffsetRect(&tempRect, kTableShadowOffset, -kTableShadowOffset);
PenPat(GetQDGlobalsGray(&dummyPattern));
PenMask(true);
ColorOval(backSrcMap, tempRect, dkGrayC);
PenNormal();
GetQDGlobalsGray(&dummyPattern);
ColorOvalMaskPattern(backSrcMap, tempRect, dkGrayC, true, dummyPattern);
InsetRect(tableTop, 0, 1);
ColorRect(backSrcMap, *tableTop, kGoldColor);
@@ -1238,7 +1224,7 @@ void DrawSimplePrizes (short what, Rect *theRect)
//-------------------------------------------------------------- DrawGreaseRt
void DrawGreaseRt (Rect *theRect, short distance, Boolean state)
void DrawGreaseRt (Rect *theRect, short distance, Boolean state, Boolean drawSpill)
{
Rect spill, dest;
@@ -1257,18 +1243,21 @@ void DrawGreaseRt (Rect *theRect, short distance, Boolean state)
(BitMap *)*GetGWorldPixMap(bonusMaskMap),
(BitMap *)*GetGWorldPixMap(backSrcMap),
&greaseSrcRt[3], &greaseSrcRt[3], &dest);
QSetRect(&spill, 0, -2, distance - 5, 0);
QOffsetRect(&spill, dest.right - 1, dest.bottom);
backSrcMap->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
backSrcMap->FillRect(spill);
if (drawSpill)
{
QSetRect(&spill, 0, -2, distance - 5, 0);
QOffsetRect(&spill, dest.right - 1, dest.bottom);
backSrcMap->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
backSrcMap->FillRect(spill);
}
}
}
//-------------------------------------------------------------- DrawGreaseLf
void DrawGreaseLf (Rect *theRect, short distance, Boolean state)
void DrawGreaseLf (Rect *theRect, short distance, Boolean state, Boolean drawSpill)
{
Rect spill, dest;
DrawSurface *wasCPort;
@@ -1289,11 +1278,14 @@ void DrawGreaseLf (Rect *theRect, short distance, Boolean state)
(BitMap *)*GetGWorldPixMap(backSrcMap),
&greaseSrcLf[3], &greaseSrcLf[3], &dest);
backSrcMap->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
if (drawSpill)
{
backSrcMap->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
QSetRect(&spill, -distance + 5, -2, 0, 0);
QOffsetRect(&spill, dest.left + 1, dest.bottom);
backSrcMap->FillRect(spill);
QSetRect(&spill, -distance + 5, -2, 0, 0);
QOffsetRect(&spill, dest.left + 1, dest.bottom);
backSrcMap->FillRect(spill);
}
}
}

View File

@@ -5,7 +5,7 @@
//----------------------------------------------------------------------------
//============================================================================
#include "BitmapImage.h"
#include "Externs.h"
#include "Environ.h"
#include "RectUtils.h"
@@ -73,11 +73,13 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
DrawSimpleBlowers(thisObject.what, &itsRect);
if (neighbor == kCentralRoom)
{
const short h = itsRect.left + 10;
const short v = itsRect.top + 7;
if (redraw)
ReBackUpFlames(localNumbers[neighbor], i);
ReBackUpFlames(localNumbers[neighbor], i, h, v);
else
AddCandleFlame(localNumbers[neighbor], i,
itsRect.left + 10, itsRect.top + 7);
h, v);
}
else
{
@@ -88,11 +90,13 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
rectB.bottom += kFloorSupportTall;
if (!SectRect(&rectA, &rectB, &whoCares))
{
const short h = itsRect.left + 10;
const short v = itsRect.top + 7;
if (redraw)
ReBackUpFlames(localNumbers[neighbor], i);
ReBackUpFlames(localNumbers[neighbor], i, h, v);
else
AddCandleFlame(localNumbers[neighbor], i,
itsRect.left + 10, itsRect.top + 7);
h, v);
}
}
}
@@ -107,11 +111,13 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
DrawSimpleBlowers(thisObject.what, &itsRect);
if (neighbor == kCentralRoom)
{
const short h = itsRect.left + 14;
const short v = itsRect.top + 7;
if (redraw)
ReBackUpFlames(localNumbers[neighbor], i);
ReBackUpFlames(localNumbers[neighbor], i, h, v);
else
AddCandleFlame(localNumbers[neighbor], i,
itsRect.left + 14, itsRect.top + 7);
h, v);
}
else
{
@@ -122,11 +128,13 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
rectB.bottom += kFloorSupportTall;
if (!SectRect(&rectA, &rectB, &whoCares))
{
const short h = itsRect.left + 14;
const short v = itsRect.top + 7;
if (redraw)
ReBackUpFlames(localNumbers[neighbor], i);
ReBackUpFlames(localNumbers[neighbor], i, h, v);
else
AddCandleFlame(localNumbers[neighbor], i,
itsRect.left + 14, itsRect.top + 7);
h, v);
}
}
}
@@ -141,11 +149,13 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
DrawSimpleBlowers(thisObject.what, &itsRect);
if (neighbor == kCentralRoom)
{
const short h = itsRect.left + 9;
const short v = itsRect.top + 7;
if (redraw)
ReBackUpFlames(localNumbers[neighbor], i);
ReBackUpFlames(localNumbers[neighbor], i, h, v);
else
AddCandleFlame(localNumbers[neighbor], i,
itsRect.left + 9, itsRect.top + 7);
h, v);
}
else
{
@@ -156,26 +166,31 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
rectB.bottom += kFloorSupportTall;
if (!SectRect(&rectA, &rectB, &whoCares))
{
const short h = itsRect.left + 9;
const short v = itsRect.top + 7;
if (redraw)
ReBackUpFlames(localNumbers[neighbor], i);
ReBackUpFlames(localNumbers[neighbor], i, h, v);
else
AddCandleFlame(localNumbers[neighbor], i,
itsRect.left + 9, itsRect.top + 7);
h, v);
}
}
}
break;
case kTiki:
GetObjectRect(&thisObject, &itsRect);
OffsetRectRoomRelative(&itsRect, neighbor);
if (isLit)
DrawTiki(&itsRect, playOriginV + VerticalRoomOffset(neighbor));
if (redraw)
ReBackUpTikiFlames(localNumbers[neighbor], i);
else
AddTikiFlame(localNumbers[neighbor], i,
itsRect.left + 10, itsRect.top - 9);
{
GetObjectRect(&thisObject, &itsRect);
OffsetRectRoomRelative(&itsRect, neighbor);
const short h = itsRect.left + 10;
const short v = itsRect.top - 9;
if (isLit)
DrawTiki(&itsRect, playOriginV + VerticalRoomOffset(neighbor));
if (redraw)
ReBackUpTikiFlames(localNumbers[neighbor], i, h, v);
else
AddTikiFlame(localNumbers[neighbor], i, h, v);
}
break;
case kBBQ:
@@ -183,13 +198,14 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
OffsetRectRoomRelative(&itsRect, neighbor);
if (SectRect(&itsRect, &testRect, &whoCares))
{
const short h = itsRect.left + 16;
const short v = itsRect.top + 9;
if (isLit)
DrawPictSansWhiteObject(thisObject.what, &itsRect);
if (redraw)
ReBackUpBBQCoals(localNumbers[neighbor], i);
ReBackUpBBQCoals(localNumbers[neighbor], i, h, v);
else
AddBBQCoals(localNumbers[neighbor], i,
itsRect.left + 16, itsRect.top + 9);
AddBBQCoals(localNumbers[neighbor], i, h, v);
}
break;
@@ -333,8 +349,10 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (legit != -1)
{
DrawCuckoo(&itsRect);
short pendulumH = itsRect.left + 4;
short pendulumV = itsRect.top + 46;
if (redraw)
ReBackUpPendulum(localNumbers[neighbor], i);
ReBackUpPendulum(localNumbers[neighbor], i, pendulumH, pendulumV);
else
AddPendulum(localNumbers[neighbor], i,
itsRect.left + 4, itsRect.top + 46);
@@ -367,17 +385,22 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
if (redraw)
dynamicNum = ReBackUpGrease(localNumbers[neighbor], i);
dynamicNum = ReBackUpGrease(localNumbers[neighbor], i, itsRect.left, itsRect.top);
else
dynamicNum = AddGrease(localNumbers[neighbor], i,
itsRect.left, itsRect.top,
thisObject.data.c.length, true);
if (dynamicNum != -1)
DrawGreaseRt(&itsRect, thisObject.data.c.length, true);
DrawGreaseRt(&itsRect, thisObject.data.c.length, true, false);
}
}
else // fallen
DrawGreaseRt(&itsRect, thisObject.data.c.length, false);
{
Boolean isDynamic = false;
if (redraw)
FixupFallenGrease(localNumbers[neighbor], i, itsRect.left, itsRect.top, &isDynamic);
DrawGreaseRt(&itsRect, thisObject.data.c.length, false, !isDynamic);
}
break;
case kGreaseLf:
@@ -388,17 +411,22 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
if (redraw)
dynamicNum = ReBackUpGrease(localNumbers[neighbor], i);
dynamicNum = ReBackUpGrease(localNumbers[neighbor], i, itsRect.left, itsRect.top);
else
dynamicNum = AddGrease(localNumbers[neighbor], i,
itsRect.left, itsRect.top,
thisObject.data.c.length, false);
if (dynamicNum != -1)
DrawGreaseLf(&itsRect, thisObject.data.c.length, true);
DrawGreaseLf(&itsRect, thisObject.data.c.length, true, false);
}
}
else
DrawGreaseLf(&itsRect, thisObject.data.c.length, false);
{
Boolean isDynamic = false;
if (redraw)
FixupFallenGrease(localNumbers[neighbor], i, itsRect.left, itsRect.top, &isDynamic);
DrawGreaseLf(&itsRect, thisObject.data.c.length, false, !isDynamic);
}
break;
case kFoil:
@@ -431,7 +459,7 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (legit != -1)
{
if (redraw)
ReBackUpStar(localNumbers[neighbor], i);
ReBackUpStar(localNumbers[neighbor], i, itsRect.left, itsRect.top);
else
AddStar(localNumbers[neighbor], i, itsRect.left,
itsRect.top);
@@ -445,12 +473,12 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
OffsetRectRoomRelative(&itsRect, neighbor);
if (SectRect(&itsRect, &testRect, &whoCares))
{
if ((!redraw) && (neighbor == kCentralRoom))
if (neighbor == kCentralRoom)
{
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kSparkle, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.c.state);
localNumbers[neighbor], i, thisObject.data.c.state, redraw);
}
}
break;
@@ -641,12 +669,12 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
DrawSimpleAppliance(thisObject.what, &itsRect);
if ((!redraw) && (neighbor == kCentralRoom))
if (neighbor == kCentralRoom)
{
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kToaster, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state);
localNumbers[neighbor], i, thisObject.data.g.state, redraw);
}
}
break;
@@ -657,13 +685,10 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
DrawMacPlus(&itsRect, thisObject.data.g.state, isLit);
if (!redraw)
{
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kMacPlus, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state);
}
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kMacPlus, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state, redraw);
}
break;
@@ -673,26 +698,27 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
#ifdef COMPILEQT
if ((thisMac.hasQT) && (hasMovie) && (neighbor == kCentralRoom) &&
(!tvInRoom))
if ((thisMac.hasQT) && (hasMovie) && (neighbor == kCentralRoom))
{
whoCares = tvScreen1;
ZeroRectCorner(&whoCares);
OffsetRect(&whoCares, itsRect.left + 17, itsRect.top + 10);
GetMovieBox(theMovie, &movieRect);
movieRect = (*theMovie.m_animPackage->GetFrame(0))->GetRect();
CenterRectInRect(&movieRect, &whoCares);
SetMovieBox(theMovie, &movieRect);
SetMovieDisplayClipRgn(theMovie, &whoCares);
tvOn = thisObject.data.g.state;
theMovie.m_renderRect = movieRect;
theMovie.m_constrainRect = whoCares;
if (!tvInRoom)
tvOn = thisObject.data.g.state;
}
#endif
DrawTV(&itsRect, thisObject.data.g.state, isLit);
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kTV, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state, redraw);
if (!redraw)
{
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kTV, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state);
#ifdef COMPILEQT
if ((thisMac.hasQT) && (hasMovie) && (neighbor == kCentralRoom) &&
(!tvInRoom))
@@ -711,13 +737,10 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
DrawCoffee(&itsRect, thisObject.data.g.state, isLit);
if (!redraw)
{
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kCoffee, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state);
}
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kCoffee, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state, redraw);
}
break;
@@ -728,13 +751,10 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
{
if (isLit)
DrawOutlet(&itsRect);
if (!redraw)
{
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kOutlet, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state);
}
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kOutlet, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state, redraw);
}
break;
@@ -744,13 +764,10 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
DrawVCR(&itsRect, thisObject.data.g.state, isLit);
if (!redraw)
{
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kVCR, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state);
}
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kVCR, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state, redraw);
}
break;
@@ -760,13 +777,10 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
DrawStereo(&itsRect, isPlayMusicGame, isLit);
if (!redraw)
{
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kStereo, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state);
}
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kStereo, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state, redraw);
}
break;
@@ -776,79 +790,76 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
DrawMicrowave(&itsRect, thisObject.data.g.state, isLit);
if (!redraw)
{
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kMicrowave, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state);
}
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kMicrowave, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.g.state, redraw);
}
break;
case kBalloon:
if ((neighbor == kCentralRoom) && (!redraw))
if (neighbor == kCentralRoom)
{
GetObjectRect(&thisObject, &itsRect);
OffsetRectRoomRelative(&itsRect, neighbor);
QOffsetRect(&itsRect, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kBalloon, &itsRect, &thisObject,
localNumbers[neighbor], i, thisObject.data.h.state);
localNumbers[neighbor], i, thisObject.data.h.state, redraw);
}
break;
case kCopterLf:
if ((neighbor == kCentralRoom) && (!redraw))
if (neighbor == kCentralRoom)
{
GetObjectRect(&thisObject, &itsRect);
OffsetRectRoomRelative(&itsRect, neighbor);
QOffsetRect(&itsRect, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kCopterLf, &itsRect, &thisObject,
localNumbers[neighbor], i, thisObject.data.h.state);
localNumbers[neighbor], i, thisObject.data.h.state, redraw);
}
break;
case kCopterRt:
if ((neighbor == kCentralRoom) && (!redraw))
if (neighbor == kCentralRoom)
{
GetObjectRect(&thisObject, &itsRect);
OffsetRectRoomRelative(&itsRect, neighbor);
QOffsetRect(&itsRect, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kCopterRt, &itsRect, &thisObject,
localNumbers[neighbor], i, thisObject.data.h.state);
localNumbers[neighbor], i, thisObject.data.h.state, redraw);
}
break;
case kDartLf:
if ((neighbor == kCentralRoom) && (!redraw))
if (neighbor == kCentralRoom)
{
GetObjectRect(&thisObject, &itsRect);
OffsetRectRoomRelative(&itsRect, neighbor);
QOffsetRect(&itsRect, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kDartLf, &itsRect, &thisObject,
localNumbers[neighbor], i, thisObject.data.h.state);
localNumbers[neighbor], i, thisObject.data.h.state, redraw);
}
break;
case kDartRt:
if ((neighbor == kCentralRoom) && (!redraw))
if (neighbor == kCentralRoom)
{
GetObjectRect(&thisObject, &itsRect);
OffsetRectRoomRelative(&itsRect, neighbor);
QOffsetRect(&itsRect, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kDartRt, &itsRect, &thisObject,
localNumbers[neighbor], i, thisObject.data.h.state);
localNumbers[neighbor], i, thisObject.data.h.state, redraw);
}
break;
case kBall:
if ((neighbor == kCentralRoom) && (!redraw))
if (neighbor == kCentralRoom)
{
GetObjectRect(&thisObject, &itsRect);
OffsetRectRoomRelative(&itsRect, neighbor);
QOffsetRect(&itsRect, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kBall, &itsRect, &thisObject,
localNumbers[neighbor], i, thisObject.data.h.state);
localNumbers[neighbor], i, thisObject.data.h.state, redraw);
}
break;
@@ -858,12 +869,12 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
DrawDrip(&itsRect);
if ((!redraw) && (neighbor == kCentralRoom))
if (neighbor == kCentralRoom)
{
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kDrip, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.h.state);
localNumbers[neighbor], i, thisObject.data.h.state, redraw);
}
}
break;
@@ -874,12 +885,12 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
DrawFish(thisObject.what, &itsRect);
if ((!redraw) && (neighbor == kCentralRoom))
if (neighbor == kCentralRoom)
{
rectA = itsRect;
QOffsetRect(&rectA, -playOriginH, -playOriginV);
dynamicNum = AddDynamicObject(kFish, &rectA, &thisObject,
localNumbers[neighbor], i, thisObject.data.h.state);
localNumbers[neighbor], i, thisObject.data.h.state, redraw);
}
}
break;
@@ -897,7 +908,7 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
OffsetRectRoomRelative(&itsRect, neighbor);
if ((SectRect(&itsRect, &testRect, &whoCares)) && isLit)
DrawMirror(&itsRect);
if ((neighbor == kCentralRoom) && (!redraw))
if (neighbor == kCentralRoom)
{
InsetRect(&itsRect, 4, 4);
AddToMirrorRegion(&itsRect);

View File

@@ -23,8 +23,8 @@
short FindObjectSelected (Point);
void DragHandle (DrawSurface *, Point);
void DragObject (DrawSurface *, Point);
void DragHandle (Window *, DrawSurface *, Point);
void DragObject (Window *, DrawSurface *, Point);
void AddObjectPairing (void);
Boolean ObjectIsUpBlower (objectType *);
@@ -53,16 +53,16 @@ short FindObjectSelected (Point where)
found = kNoObjectSelected;
if (PtInRect(where, &initialGliderRect))
if (initialGliderRect.Contains(where))
return (kInitialGliderSelected);
else if (PtInRect(where, &leftStartGliderDest))
else if (leftStartGliderDest.Contains(where))
return (kLeftGliderSelected);
else if (PtInRect(where, &rightStartGliderDest))
else if (rightStartGliderDest.Contains(where))
return (kRightGliderSelected);
for (i = kMaxRoomObs - 1; i >= 0; i--)
{
if (PtInRect(where, &roomObjectRects[i]))
if (roomObjectRects[i].Contains(where))
{
found = i;
break;
@@ -74,7 +74,7 @@ short FindObjectSelected (Point where)
//-------------------------------------------------------------- DoSelectionClick
void DoSelectionClick (DrawSurface *surface, Point where, Boolean isDoubleClick)
void DoSelectionClick (Window *window, DrawSurface *surface, Point where, Boolean isDoubleClick)
{
#ifndef COMPILEDEMO
short direction, dist;
@@ -84,7 +84,7 @@ void DoSelectionClick (DrawSurface *surface, Point where, Boolean isDoubleClick)
if ((PtInMarqueeHandle(where)) && (objActive != kNoObjectSelected))
{
if (StillDown())
DragHandle(surface, where);
DragHandle(window, surface, where);
if (ObjectHasHandle(&direction, &dist))
{
StartMarqueeHandled(&roomObjectRects[objActive], direction, dist);
@@ -117,7 +117,7 @@ void DoSelectionClick (DrawSurface *surface, Point where, Boolean isDoubleClick)
else
{
if (StillDown())
DragObject(surface, where);
DragObject(window, surface, where);
if (ObjectHasHandle(&direction, &dist))
{
StartMarqueeHandled(&roomObjectRects[objActive], direction, dist);
@@ -144,184 +144,186 @@ void DoSelectionClick (DrawSurface *surface, Point where, Boolean isDoubleClick)
//-------------------------------------------------------------- DragHandle
#ifndef COMPILEDEMO
void DragHandle (DrawSurface *surface, Point where)
void DragHandle (Window *window, DrawSurface *surface, Point where)
{
short hDelta, vDelta;
Boolean whoCares;
bool redrawMainWindow = false;
switch (thisRoom->objects[objActive].what)
{
case kFloorVent:
case kCeilingVent:
case kFloorBlower:
case kCeilingBlower:
case kSewerGrate:
case kTaper:
case kCandle:
case kStubby:
case kTiki:
case kBBQ:
case kGrecoVent:
case kSewerBlower:
case kFloorVent:
case kCeilingVent:
case kFloorBlower:
case kCeilingBlower:
case kSewerGrate:
case kTaper:
case kCandle:
case kStubby:
case kTiki:
case kBBQ:
case kGrecoVent:
case kSewerBlower:
vDelta = thisRoom->objects[objActive].data.a.distance;
DragMarqueeHandle(surface, where, &vDelta);
DragMarqueeHandle(window, surface, where, &vDelta);
thisRoom->objects[objActive].data.a.distance = vDelta;
whoCares = KeepObjectLegal();
break;
case kLiftArea:
case kLiftArea:
hDelta = thisRoom->objects[objActive].data.a.distance;
vDelta = thisRoom->objects[objActive].data.a.tall * 2;
DragMarqueeCorner(surface, where, &hDelta, &vDelta, false);
DragMarqueeCorner(window, surface, where, &hDelta, &vDelta, false);
thisRoom->objects[objActive].data.a.distance = hDelta;
thisRoom->objects[objActive].data.a.tall = vDelta / 2;
whoCares = KeepObjectLegal();
InvalWindowRect(mainWindow, &mainWindowRect);
redrawMainWindow = true;
GetThisRoomsObjRects();
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
break;
case kLeftFan:
case kRightFan:
case kLeftFan:
case kRightFan:
hDelta = thisRoom->objects[objActive].data.a.distance;
DragMarqueeHandle(surface, where, &hDelta);
DragMarqueeHandle(window, surface, where, &hDelta);
thisRoom->objects[objActive].data.a.distance = hDelta;
whoCares = KeepObjectLegal();
break;
case kInvisBlower:
case kInvisBlower:
if (((thisRoom->objects[objActive].data.a.vector & 0x0F) == 1) ||
((thisRoom->objects[objActive].data.a.vector & 0x0F) == 4))
{
vDelta = thisRoom->objects[objActive].data.a.distance;
DragMarqueeHandle(surface, where, &vDelta);
DragMarqueeHandle(window, surface, where, &vDelta);
thisRoom->objects[objActive].data.a.distance = vDelta;
}
else
{
hDelta = thisRoom->objects[objActive].data.a.distance;
DragMarqueeHandle(surface, where, &hDelta);
DragMarqueeHandle(window, surface, where, &hDelta);
thisRoom->objects[objActive].data.a.distance = hDelta;
}
whoCares = KeepObjectLegal();
break;
case kTable:
case kShelf:
case kDeckTable:
case kTable:
case kShelf:
case kDeckTable:
hDelta = RectWide(&thisRoom->objects[objActive].data.b.bounds);
DragMarqueeHandle(surface, where, &hDelta);
DragMarqueeHandle(window, surface, where, &hDelta);
thisRoom->objects[objActive].data.b.bounds.right =
thisRoom->objects[objActive].data.b.bounds.left + hDelta;
whoCares = KeepObjectLegal();
InvalWindowRect(mainWindow, &mainWindowRect);
redrawMainWindow = true;
GetThisRoomsObjRects();
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
break;
case kCabinet:
case kInvisObstacle:
case kInvisBounce:
case kCabinet:
case kInvisObstacle:
case kInvisBounce:
hDelta = RectWide(&thisRoom->objects[objActive].data.b.bounds);
vDelta = RectTall(&thisRoom->objects[objActive].data.b.bounds);
DragMarqueeCorner(surface, where, &hDelta, &vDelta, false);
DragMarqueeCorner(window, surface, where, &hDelta, &vDelta, false);
thisRoom->objects[objActive].data.b.bounds.right =
thisRoom->objects[objActive].data.b.bounds.left + hDelta;
thisRoom->objects[objActive].data.b.bounds.bottom =
thisRoom->objects[objActive].data.b.bounds.top + vDelta;
whoCares = KeepObjectLegal();
InvalWindowRect(mainWindow, &mainWindowRect);
redrawMainWindow = true;
GetThisRoomsObjRects();
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
break;
case kCounter:
case kDresser:
case kCounter:
case kDresser:
hDelta = RectWide(&thisRoom->objects[objActive].data.b.bounds);
vDelta = RectTall(&thisRoom->objects[objActive].data.b.bounds);
DragMarqueeCorner(surface, where, &hDelta, &vDelta, true);
DragMarqueeCorner(window, surface, where, &hDelta, &vDelta, true);
thisRoom->objects[objActive].data.b.bounds.right =
thisRoom->objects[objActive].data.b.bounds.left + hDelta;
thisRoom->objects[objActive].data.b.bounds.top =
thisRoom->objects[objActive].data.b.bounds.bottom - vDelta;
whoCares = KeepObjectLegal();
InvalWindowRect(mainWindow, &mainWindowRect);
redrawMainWindow = true;
GetThisRoomsObjRects();
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
break;
case kGreaseRt:
case kGreaseLf:
case kSlider:
case kGreaseRt:
case kGreaseLf:
case kSlider:
hDelta = thisRoom->objects[objActive].data.c.length;
DragMarqueeHandle(surface, where, &hDelta);
DragMarqueeHandle(window, surface, where, &hDelta);
thisRoom->objects[objActive].data.c.length = hDelta;
whoCares = KeepObjectLegal();
InvalWindowRect(mainWindow, &mainWindowRect);
redrawMainWindow = true;
GetThisRoomsObjRects();
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
break;
case kInvisTrans:
case kInvisTrans:
hDelta = thisRoom->objects[objActive].data.d.wide;
vDelta = thisRoom->objects[objActive].data.d.tall;
DragMarqueeCorner(surface, where, &hDelta, &vDelta, false);
DragMarqueeCorner(window, surface, where, &hDelta, &vDelta, false);
if (hDelta > 127)
hDelta = 127;
thisRoom->objects[objActive].data.d.wide = (Byte)hDelta;
thisRoom->objects[objActive].data.d.tall = vDelta;
whoCares = KeepObjectLegal();
InvalWindowRect(mainWindow, &mainWindowRect);
redrawMainWindow = true;
GetThisRoomsObjRects();
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
break;
case kDeluxeTrans:
case kDeluxeTrans:
hDelta = ((thisRoom->objects[objActive].data.d.tall & 0xFF00) >> 8) * 4;
vDelta = (thisRoom->objects[objActive].data.d.tall & 0x00FF) * 4;
DragMarqueeCorner(surface, where, &hDelta, &vDelta, false);
DragMarqueeCorner(window, surface, where, &hDelta, &vDelta, false);
if (hDelta < 64)
hDelta = 64;
if (vDelta < 32)
vDelta = 32;
thisRoom->objects[objActive].data.d.tall = ((hDelta / 4) << 8) + (vDelta / 4);
whoCares = KeepObjectLegal();
InvalWindowRect(mainWindow, &mainWindowRect);
redrawMainWindow = true;
GetThisRoomsObjRects();
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
break;
case kFlourescent:
case kTrackLight:
case kFlourescent:
case kTrackLight:
hDelta = thisRoom->objects[objActive].data.f.length;
DragMarqueeHandle(surface, where, &hDelta);
DragMarqueeHandle(window, surface, where, &hDelta);
thisRoom->objects[objActive].data.f.length = hDelta;
whoCares = KeepObjectLegal();
InvalWindowRect(mainWindow, &mainWindowRect);
redrawMainWindow = true;
GetThisRoomsObjRects();
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
break;
case kToaster:
case kToaster:
vDelta = thisRoom->objects[objActive].data.g.height;
DragMarqueeHandle(surface, where, &vDelta);
DragMarqueeHandle(window, surface, where, &vDelta);
thisRoom->objects[objActive].data.g.height = vDelta;
whoCares = KeepObjectLegal();
break;
case kBall:
case kDrip:
case kFish:
case kBall:
case kDrip:
case kFish:
vDelta = thisRoom->objects[objActive].data.h.length;
DragMarqueeHandle(surface, where, &vDelta);
DragMarqueeHandle(window, surface, where, &vDelta);
thisRoom->objects[objActive].data.h.length = vDelta;
whoCares = KeepObjectLegal();
break;
@@ -330,13 +332,13 @@ void DragHandle (DrawSurface *surface, Point where)
case kWallWindow:
hDelta = RectWide(&thisRoom->objects[objActive].data.i.bounds);
vDelta = RectTall(&thisRoom->objects[objActive].data.i.bounds);
DragMarqueeCorner(surface, where, &hDelta, &vDelta, false);
DragMarqueeCorner(window, surface, where, &hDelta, &vDelta, false);
thisRoom->objects[objActive].data.i.bounds.right =
thisRoom->objects[objActive].data.i.bounds.left + hDelta;
thisRoom->objects[objActive].data.i.bounds.bottom =
thisRoom->objects[objActive].data.i.bounds.top + vDelta;
whoCares = KeepObjectLegal();
InvalWindowRect(mainWindow, &mainWindowRect);
redrawMainWindow = true;
GetThisRoomsObjRects();
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
@@ -346,36 +348,39 @@ void DragHandle (DrawSurface *surface, Point where)
fileDirty = true;
UpdateMenus(false);
if (redrawMainWindow)
UpdateMainWindow();
}
#endif
//-------------------------------------------------------------- DragObject
#ifndef COMPILEDEMO
void DragObject (DrawSurface *surface, Point where)
void DragObject (Window *window, DrawSurface *surface, Point where)
{
Rect newRect, wasRect;
short deltaH, deltaV, increment;
char wasState;
Boolean invalAll;
Boolean invalAll = false;
if (objActive == kInitialGliderSelected)
{
wasRect = initialGliderRect;
newRect = initialGliderRect;
DragMarqueeRect(surface, where, &newRect, false, false);
DragMarqueeRect(window, surface, where, &newRect, false, false);
}
else if (objActive == kLeftGliderSelected)
{
wasRect = leftStartGliderDest;
newRect = leftStartGliderDest;
DragMarqueeRect(surface, where, &newRect, false, true);
DragMarqueeRect(window, surface, where, &newRect, false, true);
}
else if (objActive == kRightGliderSelected)
{
wasRect = rightStartGliderDest;
newRect = rightStartGliderDest;
DragMarqueeRect(surface, where, &newRect, false, true);
DragMarqueeRect(window, surface, where, &newRect, false, true);
}
else
{
@@ -412,13 +417,13 @@ void DragObject (DrawSurface *surface, Point where)
case kCopterRt:
case kMousehole:
case kFireplace:
DragMarqueeRect(surface, where, &newRect, true, false);
DragMarqueeRect(window, surface, where, &newRect, true, false);
invalAll = false;
break;
case kDartLf:
case kDartRt:
DragMarqueeRect(surface, where, &newRect, false, true);
DragMarqueeRect(window, surface, where, &newRect, false, true);
invalAll = false;
break;
@@ -439,14 +444,14 @@ void DragObject (DrawSurface *surface, Point where)
case kDeluxeTrans:
case kMirror:
case kWallWindow:
DragMarqueeRect(surface, where, &newRect, false, false);
DragMarqueeRect(window, surface, where, &newRect, false, false);
invalAll = true;
break;
case kCounter:
case kDresser:
case kTrackLight:
DragMarqueeRect(surface, where, &newRect, true, false);
DragMarqueeRect(window, surface, where, &newRect, true, false);
invalAll = true;
break;
@@ -516,7 +521,7 @@ void DragObject (DrawSurface *surface, Point where)
case kFaucet:
case kRug:
case kChimes:
DragMarqueeRect(surface, where, &newRect, false, false);
DragMarqueeRect(window, surface, where, &newRect, false, false);
invalAll = false;
break;
}
@@ -749,23 +754,11 @@ void DragObject (DrawSurface *surface, Point where)
{
}
GetThisRoomsObjRects();
if (invalAll)
InvalWindowRect(mainWindow, &mainWindowRect);
else
{
InvalWindowRect(mainWindow, &wasRect);
if (objActive == kInitialGliderSelected)
InvalWindowRect(mainWindow, &initialGliderRect);
else if (objActive == kLeftGliderSelected)
InvalWindowRect(mainWindow, &leftStartGliderDest);
else if (objActive == kRightGliderSelected)
InvalWindowRect(mainWindow, &rightStartGliderDest);
else
InvalWindowRect(mainWindow, &roomObjectRects[objActive]);
}
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
UpdateMainWindow();
}
#endif
@@ -1140,11 +1133,12 @@ void DeleteObject (void)
thisRoom->numObjects--;
fileDirty = true;
UpdateMenus(false);
InvalWindowRect(mainWindow, &mainWindowRect);
QSetRect(&roomObjectRects[objActive], -1, -1, 0, 0);
DeselectObject();
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
UpdateMainWindow();
#endif
}
@@ -1156,6 +1150,7 @@ void DuplicateObject (void)
Point placePt;
short direction, dist;
Boolean handled;
bool redrawMainWindow = false;
tempObject = thisRoom->objects[objActive];
@@ -1319,7 +1314,7 @@ void DuplicateObject (void)
ReadyBackground(thisRoom->background, thisRoom->tiles);
GetThisRoomsObjRects();
DrawThisRoomsObjects();
InvalWindowRect(mainWindow, &mainWindowRect);
redrawMainWindow = true;
if (handled)
{
@@ -1329,6 +1324,9 @@ void DuplicateObject (void)
else
StartMarquee(&roomObjectRects[objActive]);
}
if (redrawMainWindow)
UpdateMainWindow();
}
//-------------------------------------------------------------- MoveObject
@@ -1663,51 +1661,6 @@ void MoveObject (short whichWay, Boolean shiftDown)
UpdateMenus(false);
GetThisRoomsObjRects();
if (objActive == kInitialGliderSelected)
{
InvalWindowRect(mainWindow, &wasRect);
InvalWindowRect(mainWindow, &initialGliderRect);
}
else if (objActive == kLeftGliderSelected)
{
InvalWindowRect(mainWindow, &wasRect);
InvalWindowRect(mainWindow, &leftStartGliderDest);
}
else if (objActive == kRightGliderSelected)
{
InvalWindowRect(mainWindow, &wasRect);
InvalWindowRect(mainWindow, &rightStartGliderDest);
}
else
{
switch (thisRoom->objects[objActive].what)
{
case kTiki:
case kTable:
case kShelf:
case kCabinet:
case kDeckTable:
case kStool:
case kCounter:
case kDresser:
case kGreaseRt:
case kGreaseLf:
case kSlider:
case kMailboxLf:
case kMailboxRt:
case kTrackLight:
case kMirror:
case kWallWindow:
InvalWindowRect(mainWindow, &mainWindowRect);
break;
default:
InvalWindowRect(mainWindow, &wasRect);
InvalWindowRect(mainWindow, &roomObjectRects[objActive]);
break;
}
}
ReadyBackground(thisRoom->background, thisRoom->tiles);
DrawThisRoomsObjects();
@@ -1727,6 +1680,8 @@ void MoveObject (short whichWay, Boolean shiftDown)
else
StartMarquee(&roomObjectRects[objActive]);
}
UpdateMainWindow();
#endif
}
@@ -2315,10 +2270,7 @@ void DrawThisRoomsObjects (void)
{
if (GetNumberOfLights(thisRoomNumber) <= 0)
{
surface->SetMaskMode(true);
surface->SetPattern8x8(*GetQDGlobalsGray(&dummyPattern));
surface->FillRect(backSrcRect);
surface->SetMaskMode(false);
surface->FillRectWithPattern8x8(backSrcRect, true, *GetQDGlobalsGray(&dummyPattern));
}
for (i = 0; i < kMaxRoomObs; i++)
@@ -2436,7 +2388,7 @@ void DrawThisRoomsObjects (void)
if (!thisRoom->objects[i].data.c.initial)
QOffsetRect(&tempRect, -8, 0);
DrawGreaseRt(&tempRect, thisRoom->objects[i].data.c.length,
thisRoom->objects[i].data.c.initial);
thisRoom->objects[i].data.c.initial, true);
break;
case kGreaseLf:
@@ -2444,7 +2396,7 @@ void DrawThisRoomsObjects (void)
if (!thisRoom->objects[i].data.c.initial)
QOffsetRect(&tempRect, 8, 0);
DrawGreaseLf(&tempRect, thisRoom->objects[i].data.c.length,
thisRoom->objects[i].data.c.initial);
thisRoom->objects[i].data.c.initial, true);
break;
case kFoil:

File diff suppressed because it is too large Load Diff

View File

@@ -967,7 +967,6 @@ void BringSendFrontBack (Boolean bringFront)
fileDirty = true;
UpdateMenus(false);
InvalWindowRect(mainWindow, &mainWindowRect);
DeselectObject();
GetThisRoomsObjRects();
ReadyBackground(thisRoom->background, thisRoom->tiles);
@@ -975,6 +974,8 @@ void BringSendFrontBack (Boolean bringFront)
GenerateRetroLinks();
InitCursor();
UpdateMainWindow();
}
#endif

View File

@@ -8,6 +8,7 @@
#include "PLResources.h"
#include "PLStandardColors.h"
#include "DisplayDeviceManager.h"
#include "Externs.h"
#include "Environ.h"
#include "House.h"
@@ -53,7 +54,6 @@ short batteryTotal, bandsTotal, foilTotal, mortals;
Boolean playing, evenFrame, twoPlayerGame, showFoil, demoGoing;
Boolean doBackground, playerSuicide, phoneBitSet, tvOn;
extern WindowPtr menuWindow;
extern VFileSpec *theHousesSpecs;
extern demoPtr demoData;
extern gameType smallGame;
@@ -66,6 +66,7 @@ extern short numStarsRemaining, numChimes, saidFollow;
extern Boolean quitting, isMusicOn, gameOver, hasMirror, onePlayerLeft;
extern Boolean isPlayMusicIdle, failedMusic, quickerTransitions;
extern Boolean switchedOut;
extern short wasScoreboardTitleMode;
//============================================================== Functions
@@ -77,7 +78,6 @@ void NewGame (short mode)
PLError_t theErr;
Boolean wasPlayMusicPref;
AdjustScoreboardHeight();
gameOver = false;
theMode = kPlayMode;
if (isPlayMusicGame)
@@ -136,14 +136,14 @@ void NewGame (short mode)
DrawSurface *mainWindowSurface = mainWindow->GetDrawSurface();
tempRect = thisMac.screen;
tempRect = thisMac.constrainedScreen;
tempRect.top = tempRect.bottom - 20; // thisMac.menuHigh
mainWindowSurface->FillRect(tempRect);
#ifdef COMPILEQT
if ((thisMac.hasQT) && (hasMovie))
{
SetMovieGWorld(theMovie, &mainWindow->m_surface, nil);
theMovie.m_surface = &mainWindow->m_surface;
}
#endif
@@ -156,7 +156,7 @@ void NewGame (short mode)
// DebugStr("\pIf screen isn't black, exit to shell."); // TEMP TEMP TEMP
DrawLocale();
ResetLocale(false);
RefreshScoreboard(kNormalTitleMode);
// if (quickerTransitions)
// DissBitsChunky(&justRoomsRect);
@@ -195,11 +195,11 @@ void NewGame (short mode)
#ifdef COMPILEQT
if ((thisMac.hasQT) && (hasMovie) && (tvInRoom))
{
SetMovieActive(theMovie, true);
theMovie.m_playing = true;
if (tvOn)
{
StartMovie(theMovie);
MoviesTask(theMovie, 0);
AnimationManager::GetInstance()->RegisterPlayer(&theMovie);
AnimationManager::GetInstance()->RefreshPlayer(&theMovie);
}
}
#endif
@@ -218,8 +218,7 @@ void NewGame (short mode)
if ((thisMac.hasQT) && (hasMovie) && (tvInRoom))
{
tvInRoom = false;
StopMovie(theMovie);
SetMovieActive(theMovie, false);
theMovie.m_playing = false;
}
#endif
@@ -363,12 +362,37 @@ void SetHouseToSavedRoom (void)
ForceThisRoom(smallGame.roomNumber);
}
//-------------------------------------------------------------- HandleGameResolutionChange
void HandleGameResolutionChange(void)
{
FlushResolutionChange();
RecomputeInterfaceRects();
RecreateOffscreens();
CloseMainWindow();
OpenMainWindow();
if (hasMovie)
theMovie.m_surface = &mainWindow->m_surface;
ResetLocale(true);
InitScoreboardMap();
RefreshScoreboard(wasScoreboardTitleMode);
DumpScreenOn(&justRoomsRect);
}
//-------------------------------------------------------------- PlayGame
void PlayGame (void)
{
while ((playing) && (!quitting))
{
if (thisMac.isResolutionDirty)
{
HandleGameResolutionChange();
}
gameFrame++;
evenFrame = !evenFrame;
@@ -399,7 +423,7 @@ void PlayGame (void)
{
#ifdef COMPILEQT
if ((thisMac.hasQT) && (hasMovie) && (tvInRoom) && (tvOn))
MoviesTask(theMovie, 0);
AnimationManager::GetInstance()->RefreshPlayer(&theMovie);
#endif
RenderFrame();
HandleDynamicScoreboard();
@@ -424,7 +448,7 @@ void PlayGame (void)
{
#ifdef COMPILEQT
if ((thisMac.hasQT) && (hasMovie) && (tvInRoom) && (tvOn))
MoviesTask(theMovie, 0);
AnimationManager::GetInstance()->RefreshPlayer(&theMovie);
#endif
RenderFrame();
HandleDynamicScoreboard();
@@ -726,12 +750,12 @@ void RestoreEntireGameScreen (void)
#endif
DrawSurface *surface = mainWindow->GetDrawSurface();
tempRect = thisMac.screen;
tempRect = thisMac.constrainedScreen;
surface->SetForeColor(StdColors::Black());
surface->FillRect(tempRect);
DrawLocale();
ResetLocale(false);
RefreshScoreboard(kNormalTitleMode);
// if (quickerTransitions)
// DissBitsChunky(&justRoomsRect);

View File

@@ -12,6 +12,7 @@
#include "Objects.h"
#include "Play.h"
#include "Player.h"
#include "QDPixMap.h"
#include "RectUtils.h"
#include "Room.h"
#include "RubberBands.h"
@@ -33,9 +34,7 @@ void CopyRectsQD (void);
Rect work2MainRects[kMaxGarbageRects];
Rect back2WorkRects[kMaxGarbageRects];
Rect shieldRect;
THandle<Rect> mirrorRects;
Point shieldPt;
long nextFrame;
short numWork2Main, numBack2Work;
Boolean hasMirror;
@@ -148,7 +147,7 @@ void DrawReflection (gliderPtr thisGlider, Boolean oneOrTwo)
dest = thisGlider->dest;
QOffsetRect(&dest, playOriginH - 20, playOriginV - 16);
SetPort((GrafPtr)workSrcMap);
SetPort(&workSrcMap->m_port);
long numMirrorRects = GetHandleSize(mirrorRects.StaticCast<void>()) / sizeof(Rect);

View File

@@ -16,6 +16,7 @@
#include "House.h"
#include "InputManager.h"
#include "MainWindow.h"
#include "MemoryManager.h"
#include "RectUtils.h"
@@ -197,13 +198,13 @@ Boolean CreateNewRoom (short h, short v)
if (availableRoom == -1) // found no available rooms
{
howMuch = sizeof(roomType); // add new room to end of house
theErr = PtrAndHand((Ptr)thisRoom, thisHouse.StaticCast<void>(), howMuch);
if (theErr != PLErrors::kNone)
// add new room to end of house
if (!PortabilityLayer::MemoryManager::GetInstance()->ResizeHandle(thisHouse.MMBlock(), thisHouse.MMBlock()->m_size + sizeof(roomType)))
{
YellowAlert(kYellowUnaccounted, theErr);
YellowAlert(kYellowUnaccounted, PLErrors::kOutOfMemory);
return (false);
}
(*thisHouse)->rooms[(*thisHouse)->nRooms] = *thisRoom;
(*thisHouse)->nRooms++; // increment nRooms
numberRooms = (*thisHouse)->nRooms;
previousRoom = thisRoomNumber;
@@ -324,19 +325,12 @@ void ReflectCurrentRoom (Boolean forceMapRedraw)
}
}
GenerateRetroLinks();
DebugPixMap(backSrcMap->m_port.GetPixMap(), "DebugData/EditorSplash1");
UpdateEditWindowTitle();
DebugPixMap(backSrcMap->m_port.GetPixMap(), "DebugData/EditorSplash2");
ReadyBackground(thisRoom->background, thisRoom->tiles);
DebugPixMap(backSrcMap->m_port.GetPixMap(), "DebugData/EditorSplash3");
GetThisRoomsObjRects();
DebugPixMap(backSrcMap->m_port.GetPixMap(), "DebugData/EditorSplash4");
DrawThisRoomsObjects();
DebugPixMap(backSrcMap->m_port.GetPixMap(), "DebugData/EditorSplash5");
PL_NotYetImplemented_TODO("FixMe");
DebugPixMap(backSrcMap->m_port.GetPixMap(), "DebugData/EditorSplash6");
//InvalWindowRect(mainWindow, &mainWindowRect);
UpdateMainWindow();
#endif
}

View File

@@ -42,33 +42,41 @@ extern Boolean shadowVisible, takingTheStairs;
//============================================================== Functions
//-------------------------------------------------------------- DrawLocale
void DrawLocale (void)
void ResetLocale (Boolean soft)
{
short i, roomV;
char wasState;
DrawSurface *wasCPort;
ZeroFlamesAndTheLike();
ZeroDinahs();
KillAllBands();
ZeroMirrorRegion();
ZeroTriggers();
numTempManholes = 0;
FlushAnyTriggerPlaying();
DumpTriggerSound();
tvInRoom = false;
tvWithMovieNumber = -1;
roomV = (*thisHouse)->rooms[thisRoomNumber].floor;
for (i = 0; i < 9; i++)
if (soft)
{
localNumbers[i] = GetNeighborRoomNumber(i);
isStructure[i] = IsRoomAStructure(localNumbers[i]);
RemoveSavedMapsNotInRoom(localNumbers[kCentralRoom]);
ZeroDinahsNotInRoom(localNumbers[kCentralRoom]);
}
ListAllLocalObjects();
wasCPort = GetGraphicsPort();
else
{
ZeroFlamesAndTheLike();
ZeroDinahs();
KillAllBands();
ZeroTriggers();
numTempManholes = 0;
FlushAnyTriggerPlaying();
DumpTriggerSound();
tvInRoom = false;
tvWithMovieNumber = -1;
for (int i = 0; i < 9; i++)
{
localNumbers[i] = GetNeighborRoomNumber(i);
isStructure[i] = IsRoomAStructure(localNumbers[i]);
}
ListAllLocalObjects();
}
ZeroMirrorRegion();
takingTheStairs = false;
DrawSurface *wasCPort = GetGraphicsPort();
const short roomV = (*thisHouse)->rooms[thisRoomNumber].floor;
backSrcMap->SetForeColor(StdColors::Black());
backSrcMap->FillRect(backSrcRect);
@@ -115,14 +123,16 @@ void DrawLocale (void)
numLights = GetNumberOfLights(localNumbers[kCentralRoom]);
DrawRoomBackground(localNumbers[kCentralRoom], kCentralRoom, roomV);
DrawARoomsObjects(kCentralRoom, false);
DrawARoomsObjects(kCentralRoom, soft);
DrawLighting();
if (numNeighbors > 3)
DrawFloorSupport();
RestoreWorkMap();
shadowVisible = IsShadowVisible();
takingTheStairs = false;
if (soft)
RedrawAllGrease();
SetGraphicsPort(wasCPort);
}
@@ -380,12 +390,12 @@ void ReadyLevel (void)
{
tvInRoom = false;
tvWithMovieNumber = -1;
StopMovie(theMovie);
theMovie.m_playing = false;
}
#endif
DetermineRoomOpenings();
DrawLocale();
ResetLocale(false);
InitGarbageRects();
}

View File

@@ -14,7 +14,12 @@
#include "DialogManager.h"
#include "DialogUtils.h"
#include "Externs.h"
#include "HostDisplayDriver.h"
#include "IGpDisplayDriver.h"
#include "RectUtils.h"
#include "PLPopupMenuWidget.h"
#include "PLTimeTaggedVOSEvent.h"
#include "QDPixMap.h"
#include "ResourceCompiledRef.h"
#include "ResourceManager.h"
#include "Utilities.h"
@@ -39,12 +44,13 @@
void UpdateRoomInfoDialog (Dialog *);
void DragMiniTile (DrawSurface *, Point, short *);
void DragMiniTile (Window *, DrawSurface *, Point, short *);
void HiliteTileOver (DrawSurface *, Point);
Boolean RoomFilter (Dialog *, EventRecord *, short *);
int16_t RoomFilter (Dialog *dialog, const TimeTaggedVOSEvent *evt);
short ChooseOriginalArt (short);
void UpdateOriginalArt (Dialog *);
Boolean OriginalArtFilter (Dialog *, EventRecord *, short *);
int16_t OriginalArtFilter (Dialog *dialog, const TimeTaggedVOSEvent *evt);
Boolean PictIDExists (short);
short GetFirstPICT (void);
void BitchAboutPICTNotFound (void);
@@ -58,9 +64,11 @@ short tileOver, tempBack, cursorIs;
Boolean originalLeftOpen, originalTopOpen, originalRightOpen, originalBottomOpen;
Boolean originalFloor;
extern Cursor handCursor;
extern IGpCursor *handCursor;
extern short lastBackground;
extern PortabilityLayer::ResourceArchive *houseResFork;
//============================================================== Functions
//-------------------------------------------------------------- UpdateRoomInfoDialog
@@ -71,7 +79,6 @@ void UpdateRoomInfoDialog (Dialog *theDialog)
Rect src, dest;
short i;
DrawDialog(theDialog);
if (tempBack >= kUserBackground)
SetPopUpMenuValue(theDialog, kRoomPopupItem, kOriginalArtworkItem);
else
@@ -81,7 +88,7 @@ void UpdateRoomInfoDialog (Dialog *theDialog)
CopyBits(GetPortBitMapForCopyBits(tileSrcMap),
GetPortBitMapForCopyBits(GetDialogPort(theDialog)),
GetPortBitMapForCopyBits(theDialog->GetWindow()->GetDrawSurface()),
&tileSrcRect, &tileSrc, srcCopy);
/*
CopyBits(&((GrafPtr)tileSrcMap)->portBits,
@@ -96,7 +103,7 @@ void UpdateRoomInfoDialog (Dialog *theDialog)
QOffsetRect(&src, tempTiles[i] * kMiniTileWide, 0);
CopyBits(GetPortBitMapForCopyBits(tileSrcMap),
GetPortBitMapForCopyBits(GetDialogPort(theDialog)),
GetPortBitMapForCopyBits(theDialog->GetWindow()->GetDrawSurface()),
&src, &dest, srcCopy);
/*
CopyBits(&((GrafPtr)tileSrcMap)->portBits,
@@ -121,7 +128,7 @@ void UpdateRoomInfoDialog (Dialog *theDialog)
//-------------------------------------------------------------- DragMiniTile
#ifndef COMPILEDEMO
void DragMiniTile (DrawSurface *surface, Point mouseIs, short *newTileOver)
void DragMiniTile (Window *window, DrawSurface *surface, Point mouseIs, short *newTileOver)
{
Rect dragRect;
Point mouseWas;
@@ -142,14 +149,14 @@ void DragMiniTile (DrawSurface *surface, Point mouseIs, short *newTileOver)
mouseWas = mouseIs;
while (WaitMouseUp()) // loop until mouse button let up
{
GetMouse(&mouseIs); // get mouse coords
if (DeltaPoint(mouseWas, mouseIs) != 0L) // the mouse has moved
GetMouse(window, &mouseIs); // get mouse coords
if (mouseWas != mouseIs) // the mouse has moved
{
surface->InvertFrameRect(dragRect, pattern);
QOffsetRect(&dragRect, mouseIs.h - mouseWas.h, 0);
surface->InvertFrameRect(dragRect, pattern);
if (PtInRect(mouseIs, &tileDest)) // is cursor in the drop rect
if (tileDest.Contains(mouseIs)) // is cursor in the drop rect
{
*newTileOver = (mouseIs.h - tileDest.left) / kMiniTileWide;
if (*newTileOver != wasTileOver)
@@ -259,11 +266,11 @@ void HiliteTileOver (DrawSurface *surface, Point mouseIs)
{
short newTileOver;
if (PtInRect(mouseIs, &tileSrc))
if (tileSrc.Contains(mouseIs))
{
if (cursorIs != kHandCursor)
{
SetCursor(&handCursor);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetCursor(handCursor);
cursorIs = kHandCursor;
}
@@ -319,15 +326,14 @@ void HiliteTileOver (DrawSurface *surface, Point mouseIs)
}
surface->SetForeColor(StdColors::Black());
PenNormal();
tileOver = -1;
}
if (PtInRect(mouseIs, &editTETextBox))
if (editTETextBox.Contains(mouseIs))
{
if (cursorIs != kBeamCursor)
{
SetBuiltinCursor(iBeamCursor);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetStandardCursor(EGpStandardCursors::kIBeam);
cursorIs = kBeamCursor;
}
}
@@ -346,134 +352,135 @@ void HiliteTileOver (DrawSurface *surface, Point mouseIs)
//-------------------------------------------------------------- RoomFilter
#ifndef COMPILEDEMO
Boolean RoomFilter (Dialog *dial, EventRecord *event, short *item)
int16_t RoomFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
{
Point mouseIs;
short newTileOver;
if (!evt)
return -1;
Window *window = dial->GetWindow();
DrawSurface *surface = dial->GetWindow()->GetDrawSurface();
switch (event->what)
if (evt->IsKeyDownEvent())
{
case keyDown:
switch (event->message)
switch (PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent))
{
case PL_KEY_SPECIAL(kEnter):
case PL_KEY_NUMPAD_SPECIAL(kEnter):
case PL_KEY_SPECIAL(kEnter):
case PL_KEY_NUMPAD_SPECIAL(kEnter):
FlashDialogButton(dial, kOkayButton);
*item = kOkayButton;
return(true);
break;
return kOkayButton;
case PL_KEY_SPECIAL(kEscape):
case PL_KEY_SPECIAL(kEscape):
FlashDialogButton(dial, kCancelButton);
*item = kCancelButton;
return(true);
break;
return kCancelButton;
case PL_KEY_SPECIAL(kTab):
case PL_KEY_SPECIAL(kTab):
SelectDialogItemText(dial, kRoomNameItem, 0, 1024);
return(true);
break;
default:
return(false);
}
break;
case mouseDown:
mouseIs = event->where;
mouseIs -= dial->GetWindow()->TopLeftCoord();
if (PtInRect(mouseIs, &tileSrc))
{
if (StillDown())
{
DragMiniTile(surface, mouseIs, &newTileOver);
if ((newTileOver >= 0) && (newTileOver < kNumTiles))
{
tempTiles[newTileOver] = tileOver;
UpdateRoomInfoDialog(dial);
}
}
return(true);
}
else
return(false);
break;
case mouseUp:
return(false);
break;
case updateEvt:
SetPortDialogPort(dial);
UpdateRoomInfoDialog(dial);
EndUpdate(dial->GetWindow());
event->what = nullEvent;
return(false);
break;
return 0;
default:
GetMouse(&mouseIs);
HiliteTileOver(surface, mouseIs);
return(false);
break;
return -1;
}
}
else if (evt->m_vosEvent.m_eventType == GpVOSEventTypes::kMouseInput)
{
const GpMouseInputEvent &mouseEvent = evt->m_vosEvent.m_event.m_mouseInputEvent;
if (evt->IsLMouseDownEvent())
{
mouseIs = Point::Create(mouseEvent.m_x, mouseEvent.m_y);
mouseIs -= dial->GetWindow()->TopLeftCoord();
if (tileSrc.Contains(mouseIs))
{
if (StillDown())
{
DragMiniTile(window, surface, mouseIs, &newTileOver);
if ((newTileOver >= 0) && (newTileOver < kNumTiles))
{
tempTiles[newTileOver] = tileOver;
UpdateRoomInfoDialog(dial);
}
}
return 0;
}
else
return -1;
}
else if (mouseEvent.m_eventType == GpMouseEventTypes::kMove)
{
mouseIs = dial->GetWindow()->MouseToLocal(mouseEvent);
HiliteTileOver(surface, mouseIs);
return -1;
}
}
return -1;
}
#endif
//-------------------------------------------------------------- DoRoomInfo
void DoRoomInfo (void)
void DoRoomInfo(void)
{
#ifndef COMPILEDEMO
#define kBackgroundsMenuID 140
#define kBackgroundsMenuID 140
Dialog *roomInfoDialog;
MenuHandle backgroundsMenu;
Str255 floorStr, suiteStr, objectsStr, tempStr;
short item, i, newBack;
char wasState;
Boolean leaving, wasFirstRoom, forceDraw;
PLError_t theErr;
tileOver = -1;
cursorIs = kArrowCursor;
tempBack = thisRoom->background;
backgroundsMenu = GetMenu(kBackgroundsMenuID);
// SetMenuItemTextStyle(backgroundsMenu, kOriginalArtworkItem, italic);
if (HouseHasOriginalPicts())
EnableMenuItem(backgroundsMenu, kOriginalArtworkItem);
// SetMenuItemTextStyle(backgroundsMenu, kOriginalArtworkItem, italic);
NumToString(thisRoom->floor, floorStr);
NumToString(thisRoom->suite, suiteStr);
NumToString(thisRoom->numObjects, objectsStr);
DialogTextSubstitutions substitutions(floorStr, suiteStr, objectsStr);
theErr = CreateOffScreenGWorld(&tileSrcMap, &tileSrcRect, kPreferredPixelFormat);
// CreateOffScreenPixMap(&tileSrcRect, &tileSrcMap);
// SetPort((GrafPtr)tileSrcMap);
// CreateOffScreenPixMap(&tileSrcRect, &tileSrcMap);
// SetPort((GrafPtr)tileSrcMap);
if ((tempBack > kStars) && (!PictIDExists(tempBack)))
{
BitchAboutPICTNotFound();
tempBack = kSimpleRoom;
}
if ((tempBack == 2002) || (tempBack == 2011) ||
(tempBack == 2016) || (tempBack == 2017))
if ((tempBack == 2002) || (tempBack == 2011) ||
(tempBack == 2016) || (tempBack == 2017))
LoadScaledGraphicCustom(tileSrcMap, tempBack - 800, &tileSrcRect);
else
LoadScaledGraphicCustom(tileSrcMap, tempBack, &tileSrcRect);
for (i = 0; i < kNumTiles; i++)
tempTiles[i] = thisRoom->tiles[i];
// CenterDialog(kRoomInfoDialogID);
// CenterDialog(kRoomInfoDialogID);
roomInfoDialog = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kRoomInfoDialogID, kPutInFront, &substitutions);
if (roomInfoDialog == nil)
RedAlert(kErrDialogDidntLoad);
SetPort((GrafPtr)roomInfoDialog);
// Fix this later. TEMP
// AddMenuToPopUp(roomInfoDialog, kRoomPopupItem, backgroundsMenu);
SetPort(&roomInfoDialog->GetWindow()->GetDrawSurface()->m_port);
{
PortabilityLayer::WidgetBasicState state;
GetDialogItemRect(roomInfoDialog, kRoomPopupItem, &state.m_rect);
state.m_resID = kBackgroundsMenuID;
state.m_enabled = true;
PortabilityLayer::PopupMenuWidget *roomPopupWidget = PortabilityLayer::PopupMenuWidget::Create(state);
roomInfoDialog->ReplaceWidget(kRoomPopupItem - 1, roomPopupWidget);
if (HouseHasOriginalPicts())
EnableMenuItem(roomPopupWidget->GetMenu(), kOriginalArtworkItem);
}
if (tempBack >= kUserBackground)
SetPopUpMenuValue(roomInfoDialog, kRoomPopupItem, kOriginalArtworkItem);
else
@@ -497,10 +504,14 @@ void DoRoomInfo (void)
MyDisableControl(roomInfoDialog, kBoundsButton);
leaving = false;
UpdateRoomInfoDialog(roomInfoDialog);
while (!leaving)
{
ModalDialog(RoomFilter, &item);
bool needRedraw = false;
item = roomInfoDialog->ExecuteModal(RoomFilter);
if (item == kOkayButton)
{
@@ -548,8 +559,7 @@ void DoRoomInfo (void)
{
tempBack = newBack;
LoadScaledGraphicCustom(tileSrcMap, tempBack, &tileSrcRect);
InvalWindowRect(roomInfoDialog->GetWindow(), &tileSrc);
InvalWindowRect(roomInfoDialog->GetWindow(), &tileDest);
needRedraw = true;
}
}
else
@@ -576,8 +586,7 @@ void DoRoomInfo (void)
LoadScaledGraphicCustom(tileSrcMap, tempBack - 800, &tileSrcRect);
else
LoadScaledGraphicCustom(tileSrcMap, tempBack, &tileSrcRect);
InvalWindowRect(roomInfoDialog->GetWindow(), &tileSrc);
InvalWindowRect(roomInfoDialog->GetWindow(), &tileDest);
needRedraw = true;
}
}
else if (item == kBoundsButton)
@@ -587,10 +596,12 @@ void DoRoomInfo (void)
{
tempBack = newBack;
LoadScaledGraphicCustom(tileSrcMap, tempBack, &tileSrcRect);
InvalWindowRect(roomInfoDialog->GetWindow(), &tileSrc);
InvalWindowRect(roomInfoDialog->GetWindow(), &tileDest);
needRedraw = true;
}
}
if (needRedraw)
UpdateRoomInfoDialog(roomInfoDialog);
}
InitCursor();
@@ -607,133 +618,83 @@ void DoRoomInfo (void)
#ifndef COMPILEDEMO
void UpdateOriginalArt (Dialog *theDialog)
{
Pattern dummyPattern;
Pattern grayPattern;
GetQDGlobalsGray(&grayPattern);
DrawDialog(theDialog);
DrawDefaultButton(theDialog);
PenSize(2, 1);
if (!originalLeftOpen)
BorderDialogItem(theDialog, 7, 8);
BorderDialogItem(theDialog, 7, 8, 2, nullptr);
else
{
PenPat(GetQDGlobalsGray(&dummyPattern));
BorderDialogItem(theDialog, 7, 8);
PenPat(GetQDGlobalsBlack(&dummyPattern));
}
BorderDialogItem(theDialog, 7, 8, 2, grayPattern);
PenSize(1, 2);
if (!originalTopOpen)
BorderDialogItem(theDialog, 8, 4);
BorderDialogItem(theDialog, 8, 4, 2, nullptr);
else
{
PenPat(GetQDGlobalsGray(&dummyPattern));
BorderDialogItem(theDialog, 8, 4);
PenPat(GetQDGlobalsBlack(&dummyPattern));
}
BorderDialogItem(theDialog, 8, 4, 2, grayPattern);
PenSize(2, 1);
if (!originalRightOpen)
BorderDialogItem(theDialog, 9, 1);
BorderDialogItem(theDialog, 9, 1, 2, nullptr);
else
{
PenPat(GetQDGlobalsGray(&dummyPattern));
BorderDialogItem(theDialog, 9, 1);
PenPat(GetQDGlobalsBlack(&dummyPattern));
}
BorderDialogItem(theDialog, 9, 1, 2, grayPattern);
PenSize(1, 2);
if (!originalBottomOpen)
BorderDialogItem(theDialog, 10, 2);
BorderDialogItem(theDialog, 10, 2, 2, nullptr);
else
{
PenPat(GetQDGlobalsGray(&dummyPattern));
BorderDialogItem(theDialog, 10, 2);
PenPat(GetQDGlobalsBlack(&dummyPattern));
}
PenSize(1, 1);
BorderDialogItem(theDialog, 10, 2, 2, grayPattern);
}
#endif
//-------------------------------------------------------------- OriginalArtFilter
#ifndef COMPILEDEMO
Boolean OriginalArtFilter (Dialog *dial, EventRecord *event, short *item)
int16_t OriginalArtFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
{
Point mouseIs;
switch (event->what)
if (!evt)
return -1;
if (evt->IsKeyDownEvent())
{
case keyDown:
switch (event->message)
switch (PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent))
{
case PL_KEY_SPECIAL(kEnter):
case PL_KEY_NUMPAD_SPECIAL(kEnter):
case PL_KEY_SPECIAL(kEnter):
case PL_KEY_NUMPAD_SPECIAL(kEnter):
FlashDialogButton(dial, kOkayButton);
*item = kOkayButton;
return(true);
break;
return kOkayButton;
case PL_KEY_SPECIAL(kEscape):
case PL_KEY_SPECIAL(kEscape):
FlashDialogButton(dial, kCancelButton);
*item = kCancelButton;
return(true);
break;
return kCancelButton;
case PL_KEY_SPECIAL(kTab):
case PL_KEY_SPECIAL(kTab):
SelectDialogItemText(dial, kPICTIDItem, 0, 1024);
return(true);
break;
default:
return(false);
}
break;
case mouseDown:
mouseIs = event->where;
mouseIs -= dial->GetWindow()->TopLeftCoord();
if (PtInRect(mouseIs, &leftBound))
{
*item = 7;
return(true);
}
else if (PtInRect(mouseIs, &topBound))
{
*item = 8;
return(true);
}
else if (PtInRect(mouseIs, &rightBound))
{
*item = 9;
return(true);
}
else if (PtInRect(mouseIs, &bottomBound))
{
*item = 10;
return(true);
}
else
return(false);
break;
case mouseUp:
return(false);
break;
case updateEvt:
SetPortDialogPort(dial);
UpdateOriginalArt(dial);
EndUpdate(dial->GetWindow());
event->what = nullEvent;
return(false);
break;
return 0;
default:
return(false);
break;
return -1;
}
}
else if (evt->IsLMouseDownEvent())
{
const GpMouseInputEvent &mouseEvt = evt->m_vosEvent.m_event.m_mouseInputEvent;
mouseIs = Point::Create(mouseEvt.m_x, mouseEvt.m_y);
mouseIs -= dial->GetWindow()->TopLeftCoord();
if (leftBound.Contains(mouseIs))
return 7;
else if (topBound.Contains(mouseIs))
return 8;
else if (rightBound.Contains(mouseIs))
return 9;
else if (bottomBound.Contains(mouseIs))
return 10;
else
return -1;
}
return -1;
}
#endif
@@ -780,10 +741,12 @@ short ChooseOriginalArt (short was)
SetDialogItemValue(theDialog, kFloorSupportCheck, (short)originalFloor);
leaving = false;
UpdateOriginalArt(theDialog);
while (!leaving)
{
ModalDialog(OriginalArtFilter, &item);
item = theDialog->ExecuteModal(OriginalArtFilter);
if (item == kOkayButton)
{
@@ -908,18 +871,11 @@ short GetFirstPICT (void)
Handle resHandle;
Str255 resName;
PL_NotYetImplemented();
int16_t resID = 0;
if (!houseResFork->FindFirstResourceOfType('PICT', resID))
return -1;
//resHandle = Get1IndResource('PICT', 1);
resHandle = Handle();
if (resHandle != nil)
{
const PortabilityLayer::ResourceArchiveRef *resRef = PortabilityLayer::ResourceManager::GetInstance()->ResourceForHandle(resHandle.MMBlock());
resHandle.Dispose();
return resRef->m_resID;
}
else
return (-1);
return resID;
}
//-------------------------------------------------------------- BitchAboutPICTNotFound

View File

@@ -11,6 +11,7 @@
#include "Externs.h"
#include "Environ.h"
#include "MenuManager.h"
#include "QDPixMap.h"
#include "QDStandardPalette.h"
#include "RectUtils.h"
@@ -41,7 +42,7 @@ Rect badgesBlankRects[4], badgesBadgesRects[4];
Rect badgesDestRects[4];
DrawSurface *boardPSrcMap;
long displayedScore;
short wasScoreboardMode;
short wasScoreboardTitleMode;
Boolean doRollScore;
extern Rect localRoomsDest[], justRoomsRect;
@@ -62,6 +63,7 @@ void MarkScoreboardPortDirty(void)
void RefreshScoreboard (SInt16 mode)
{
wasScoreboardTitleMode = mode;
doRollScore = true;
RefreshRoomTitle(mode);
@@ -406,52 +408,3 @@ void QuickFoilRefresh (Boolean flash)
MarkScoreboardPortDirty();
}
//-------------------------------------------------------------- AdjustScoreboardHeight
void AdjustScoreboardHeight (void)
{
short offset, newMode;
if (numNeighbors == 9)
newMode = kScoreboardHigh;
else
newMode = kScoreboardLow;
if (wasScoreboardMode != newMode)
{
switch (newMode)
{
case kScoreboardHigh: // 9 neighbors
offset = localRoomsDest[kCentralRoom].top;
offset = -offset;
justRoomsRect = workSrcRect;
break;
case kScoreboardLow: // 1 or 3 neighbors
offset = localRoomsDest[kCentralRoom].top;
justRoomsRect = workSrcRect;
justRoomsRect.top = localRoomsDest[kCentralRoom].top;
justRoomsRect.bottom = localRoomsDest[kCentralRoom].bottom;
break;
}
QOffsetRect(&boardDestRect, 0, offset);
QOffsetRect(&boardGQDestRect, 0, offset);
QOffsetRect(&boardPQDestRect, 0, offset);
QOffsetRect(&badgesDestRects[kBatteryBadge], 0, offset);
QOffsetRect(&badgesDestRects[kBandsBadge], 0, offset);
QOffsetRect(&badgesDestRects[kFoilBadge], 0, offset);
QOffsetRect(&badgesDestRects[kHeliumBadge], 0, offset);
wasScoreboardMode = newMode;
}
}
//-------------------------------------------------------------- BlackenScoreboard
void BlackenScoreboard (DrawSurface *surface)
{
UpdateMenuBarWindow(surface);
}

View File

@@ -44,7 +44,7 @@
void UpdateLoadDialog (Dialog *);
void PageUpHouses (Dialog *);
void PageDownHouses (Dialog *);
int16_t LoadFilter (Dialog *, const TimeTaggedVOSEvent &);
int16_t LoadFilter (Dialog *, const TimeTaggedVOSEvent *);
void SortHouseList (void);
void DoDirSearch (void);
@@ -76,7 +76,7 @@ void UpdateLoadDialog (Dialog *theDialog)
theWindow = theDialog->GetWindow();
DrawSurface *surface = theWindow->GetDrawSurface();
GetWindowBounds(theWindow, kWindowContentRgn, &dialogRect);
dialogRect = theWindow->GetDrawSurface()->m_port.GetRect();
ColorFrameWHRect(theDialog->GetWindow()->GetDrawSurface(), 8, 39, 413, 184, kRedOrangeColor8); // box around files
@@ -201,13 +201,16 @@ void PageDownHouses (Dialog *theDial)
//-------------------------------------------------------------- LoadFilter
#ifndef COMPILEDEMO
int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
{
short screenCount, i, wasIndex;
if (evt.IsKeyDownEvent())
if (!evt)
return -1;
if (evt->IsKeyDownEvent())
{
const intptr_t keyCode = PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent);
const intptr_t keyCode = PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent);
switch (keyCode)
{
case PL_KEY_SPECIAL(kEnter):
@@ -226,7 +229,6 @@ int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
return kScrollDownItem;
case PL_KEY_SPECIAL(kUpArrow):
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
thisHouseIndex -= 4;
if (thisHouseIndex < 0)
{
@@ -240,23 +242,20 @@ int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
if (thisHouseIndex >= screenCount)
thisHouseIndex -= 4;
}
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
UpdateLoadDialog(dial);
return 0;
case PL_KEY_SPECIAL(kDownArrow):
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
thisHouseIndex += 4;
screenCount = housesFound - housePage;
if (screenCount > kDispFiles)
screenCount = kDispFiles;
if (thisHouseIndex >= screenCount)
thisHouseIndex %= 4;
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
UpdateLoadDialog(dial);
return 0;
case PL_KEY_SPECIAL(kLeftArrow):
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
thisHouseIndex--;
if (thisHouseIndex < 0)
{
@@ -265,19 +264,18 @@ int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
screenCount = kDispFiles;
thisHouseIndex = screenCount - 1;
}
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
UpdateLoadDialog(dial);
return 0;
case PL_KEY_SPECIAL(kTab):
case PL_KEY_SPECIAL(kRightArrow):
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
thisHouseIndex++;
screenCount = housesFound - housePage;
if (screenCount > kDispFiles)
screenCount = kDispFiles;
if (thisHouseIndex >= screenCount)
thisHouseIndex = 0;
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
UpdateLoadDialog(dial);
return 0;
default:
@@ -305,10 +303,7 @@ int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
thisHouseIndex = screenCount - 1;
}
if (wasIndex != thisHouseIndex)
{
InvalWindowRect(dial->GetWindow(), &loadHouseRects[wasIndex]);
InvalWindowRect(dial->GetWindow(), &loadHouseRects[thisHouseIndex]);
}
UpdateLoadDialog(dial);
}
return 0;
}
@@ -316,20 +311,20 @@ int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
return -1;
}
}
else if (evt.IsLMouseDownEvent())
else if (evt->IsLMouseDownEvent())
{
const GpMouseInputEvent &mouseEvt = evt.m_vosEvent.m_event.m_mouseInputEvent;
const GpMouseInputEvent &mouseEvt = evt->m_vosEvent.m_event.m_mouseInputEvent;
lastWhenClick = evt.m_timestamp - lastWhenClick;
lastWhenClick = evt->m_timestamp - lastWhenClick;
lastWhereClick -= Point::Create(mouseEvt.m_x, mouseEvt.m_y);
return -1;
}
else if (evt.IsLMouseUpEvent())
else if (evt->IsLMouseUpEvent())
{
const GpMouseInputEvent &mouseEvt = evt.m_vosEvent.m_event.m_mouseInputEvent;
const GpMouseInputEvent &mouseEvt = evt->m_vosEvent.m_event.m_mouseInputEvent;
lastWhenClick = evt.m_timestamp;
lastWhenClick = evt->m_timestamp;
lastWhereClick = Point::Create(mouseEvt.m_x, mouseEvt.m_y);
return -1;

View File

@@ -31,13 +31,16 @@
#define kDisplay1Item 3
#define kDisplay3Item 4
#define kDisplay9Item 5
#define kBorder1Item 8
#define kDoColorFadeItem 9
#define kCurrentDepth 10
#define k256Depth 11
#define k16Depth 12
#define kDispDefault 15
#define kUseQDItem 16
#define kUseScreen2Item 17
//#define kCurrentDepth 10
//#define k256Depth 11
//#define k16Depth 12
#define kBorder2Item 10
#define kBorder3Item 11
#define kDispDefault 12
//#define kUseQDItem 13
//#define kUseScreen2Item 14
#define kSofterItem 4
#define kLouderItem 5
#define kVolNumberItem 7
@@ -64,27 +67,27 @@
void SetBrainsToDefaults (Dialog *);
void UpdateSettingsBrains (Dialog *);
int16_t BrainsFilter (Dialog *, const TimeTaggedVOSEvent &);
int16_t BrainsFilter (Dialog *, const TimeTaggedVOSEvent *);
void DoBrainsPrefs (void);
void SetControlsToDefaults (Dialog *);
void UpdateControlKeyName (Dialog *);
void UpdateSettingsControl (Dialog *);
int16_t ControlFilter (Dialog *, const TimeTaggedVOSEvent &);
int16_t ControlFilter (Dialog *, const TimeTaggedVOSEvent *);
void DoControlPrefs (void);
void SoundDefaults (Dialog *);
void UpdateSettingsSound (Dialog *);
void HandleSoundMusicChange (short, Boolean);
int16_t SoundFilter(Dialog *, const TimeTaggedVOSEvent &);
int16_t SoundFilter(Dialog *, const TimeTaggedVOSEvent *);
void DoSoundPrefs (void);
void DisplayDefaults (void);
void FrameDisplayIcon (Dialog *, const PortabilityLayer::RGBAColor &color);
void DisplayUpdate (Dialog *);
int16_t DisplayFilter(Dialog *dialog, const TimeTaggedVOSEvent &);
int16_t DisplayFilter(Dialog *dialog, const TimeTaggedVOSEvent *);
void DoDisplayPrefs (void);
void SetAllDefaults (void);
void FlashSettingsButton (DrawSurface *, short);
void UpdateSettingsMain (Dialog *);
int16_t PrefsFilter(Dialog *dialog, const TimeTaggedVOSEvent &evt);
int16_t PrefsFilter(Dialog *dialog, const TimeTaggedVOSEvent *evt);
void BitchAboutChanges (void);
@@ -145,11 +148,14 @@ void UpdateSettingsBrains (Dialog *theDialog)
//-------------------------------------------------------------- BrainsFilter
int16_t BrainsFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
int16_t BrainsFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
{
if (evt.IsKeyDownEvent())
if (!evt)
return -1;
if (evt->IsKeyDownEvent())
{
intptr_t keyCode = PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent);
intptr_t keyCode = PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent);
switch (keyCode)
{
@@ -186,6 +192,19 @@ int16_t BrainsFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
}
}
if (evt->m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
{
const GpKeyboardInputEvent &keyEvent = evt->m_vosEvent.m_event.m_keyboardInputEvent;
if (keyEvent.m_keyIDSubset == GpKeyIDSubsets::kUnicode)
return 0;
if (keyEvent.m_keyIDSubset == GpKeyIDSubsets::kASCII)
{
char asciiChar = (keyEvent.m_key.m_asciiChar);
if (asciiChar < '0' || asciiChar > '9')
return 0;
}
}
return -1;
}
@@ -220,6 +239,8 @@ void DoBrainsPrefs (void)
UpdateSettingsBrains(prefDlg);
prefDlg->GetWindow()->FocusWidget(prefDlg->GetItems()[kMaxFilesItem - 1].GetWidget());
while (!leaving)
{
itemHit = prefDlg->ExecuteModal(BrainsFilter);
@@ -353,18 +374,21 @@ void UpdateSettingsControl (Dialog *theDialog)
//-------------------------------------------------------------- ControlFilter
int16_t ControlFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
int16_t ControlFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
{
intptr_t wasKeyMap;
if (evt.IsKeyDownEvent())
if (!evt)
return -1;
if (evt->IsKeyDownEvent())
{
GpKeyIDSubset_t subset = evt.m_vosEvent.m_event.m_keyboardInputEvent.m_keyIDSubset;
GpKeyIDSubset_t subset = evt->m_vosEvent.m_event.m_keyboardInputEvent.m_keyIDSubset;
// Ignore Unicode (for now) and gamepad buttons
if (subset == GpKeyIDSubsets::kASCII || subset == GpKeyIDSubsets::kSpecial || subset == GpKeyIDSubsets::kNumPadNumber || subset == GpKeyIDSubsets::kNumPadSpecial || subset == GpKeyIDSubsets::kFKey)
{
wasKeyMap = PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent);
wasKeyMap = PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent);
switch (whichCtrl)
{
@@ -626,13 +650,16 @@ void HandleSoundMusicChange (short newVolume, Boolean sayIt)
//-------------------------------------------------------------- SoundFilter
int16_t SoundFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
int16_t SoundFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
{
short newVolume;
if (evt.IsKeyDownEvent())
if (!evt)
return -1;
if (evt->IsKeyDownEvent())
{
intptr_t keyCode = PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent);
intptr_t keyCode = PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent);
switch (keyCode)
{
@@ -870,26 +897,25 @@ void DisplayUpdate (Dialog *theDialog)
DrawDefaultButton(theDialog);
SetDialogItemValue(theDialog, kDoColorFadeItem, (short)wasFade);
SelectFromRadioGroup(theDialog, kCurrentDepth + wasDepthPref,
kCurrentDepth, k16Depth);
// SetDialogItemValue(theDialog, kUseQDItem, (short)wasQD);
SetDialogItemValue(theDialog, kUseScreen2Item, (short)wasScreen2);
ForeColor(redColor);
FrameDisplayIcon(theDialog, StdColors::Red());
ForeColor(blackColor);
FrameDialogItemC(theDialog, 8, kRedOrangeColor8);
FrameDialogItemC(theDialog, 13, kRedOrangeColor8);
FrameDialogItemC(theDialog, 14, kRedOrangeColor8);
FrameDialogItemC(theDialog, kBorder1Item, kRedOrangeColor8);
FrameDialogItemC(theDialog, kBorder2Item, kRedOrangeColor8);
FrameDialogItemC(theDialog, kBorder3Item, kRedOrangeColor8);
}
//-------------------------------------------------------------- DisplayFilter
int16_t DisplayFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
int16_t DisplayFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
{
if (evt.IsKeyDownEvent())
if (!evt)
return -1;
if (evt->IsKeyDownEvent())
{
switch (PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent))
switch (PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent))
{
case PL_KEY_SPECIAL(kEnter):
case PL_KEY_NUMPAD_SPECIAL(kEnter):
@@ -934,37 +960,6 @@ int16_t DisplayFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
}
break;
case PL_KEY_SPECIAL(kUpArrow):
switch (wasDepthPref)
{
case kSwitchIfNeeded:
return k16Depth;
case kSwitchTo256Colors:
return kCurrentDepth;
case kSwitchTo16Grays:
return k256Depth;
default:
return -1;
}
break;
case PL_KEY_SPECIAL(kDownArrow):
switch (wasDepthPref)
{
case kSwitchIfNeeded:
return k256Depth;
case kSwitchTo256Colors:
return k16Depth;
case kSwitchTo16Grays:
return kCurrentDepth;
}
break;
case PL_KEY_ASCII('1'):
return kDisplay1Item;
@@ -981,15 +976,6 @@ int16_t DisplayFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
FlashDialogButton(dial, kDispDefault);
return kDispDefault;
case PL_KEY_ASCII('R'):
PL_NotYetImplemented_TODO("FixMe"); // GP: This looks like a bug
FlashDialogButton(dial, kUseQDItem);
return kUseScreen2Item;
case PL_KEY_ASCII('U'):
return kUseQDItem;
default:
return -1;
}
@@ -1009,14 +995,8 @@ void DoDisplayPrefs (void)
BringUpDialog(&prefDlg, kDisplayPrefsDialID, nullptr);
if (!thisMac.can8Bit)
{
MyDisableControl(prefDlg, kDoColorFadeItem);
MyDisableControl(prefDlg, k256Depth);
}
if (!thisMac.can4Bit)
MyDisableControl(prefDlg, k16Depth);
if (thisMac.numScreens < 2)
MyDisableControl(prefDlg, kUseScreen2Item);
wasNeighbors = numNeighbors;
wasFade = isDoColorFade;
wasDepthPref = isDepthPref;
@@ -1051,7 +1031,7 @@ void DoDisplayPrefs (void)
break;
case kDisplay3Item:
if (thisMac.screen.right > 512)
if (thisMac.constrainedScreen.right > 512)
{
FrameDisplayIcon(prefDlg, StdColors::White());
numNeighbors = 3;
@@ -1060,7 +1040,7 @@ void DoDisplayPrefs (void)
break;
case kDisplay9Item:
if (thisMac.screen.right > 512)
if (thisMac.constrainedScreen.right > 512)
{
FrameDisplayIcon(prefDlg, StdColors::White());
numNeighbors = 9;
@@ -1073,29 +1053,12 @@ void DoDisplayPrefs (void)
SetDialogItemValue(prefDlg, kDoColorFadeItem, (short)wasFade);
break;
case kCurrentDepth:
case k256Depth:
case k16Depth:
wasDepthPref = itemHit - kCurrentDepth;
SelectFromRadioGroup(prefDlg, itemHit, kCurrentDepth, k16Depth);
break;
case kDispDefault:
FrameDisplayIcon(prefDlg, StdColors::White());
ForeColor(blackColor);
DisplayDefaults();
DisplayUpdate(prefDlg);
break;
case kUseQDItem:
// wasQD = !wasQD;
// SetDialogItemValue(prefDlg, kUseQDItem, (short)wasQD);
break;
case kUseScreen2Item:
wasScreen2 = !wasScreen2;
SetDialogItemValue(prefDlg, kUseScreen2Item, (short)wasScreen2);
break;
}
}
@@ -1194,14 +1157,17 @@ void UpdateSettingsMain (Dialog *theDialog)
//-------------------------------------------------------------- PrefsFilter
int16_t PrefsFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
int16_t PrefsFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
{
short i;
Boolean foundHit;
if (evt.IsKeyDownEvent())
if (!evt)
return -1;
if (evt->IsKeyDownEvent())
{
intptr_t packedKey = PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent);
intptr_t packedKey = PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent);
switch (packedKey)
{
@@ -1226,10 +1192,10 @@ int16_t PrefsFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
return -1;
}
}
else if (evt.IsLMouseDownEvent())
else if (evt->IsLMouseDownEvent())
{
const Window *window = dial->GetWindow();
const GpMouseInputEvent &mouseEvent = evt.m_vosEvent.m_event.m_mouseInputEvent;
const GpMouseInputEvent &mouseEvent = evt->m_vosEvent.m_event.m_mouseInputEvent;
const Point testPt = Point::Create(mouseEvent.m_x - window->m_wmX, mouseEvent.m_y - window->m_wmY);

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