mirror of
https://github.com/elasota/Aerofoil.git
synced 2026-03-02 13:51:34 +00:00
Compare commits
89 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24f43b973a | ||
|
|
649d78a61b | ||
|
|
836fc95f4a | ||
|
|
5b95fd8c6b | ||
|
|
b55a508686 | ||
|
|
47291cbf1d | ||
|
|
01e6ff4f5d | ||
|
|
d828eacd38 | ||
|
|
b37b0a4f8a | ||
|
|
4c3ccbd7fa | ||
|
|
9624c283c8 | ||
|
|
cfb66d9c9b | ||
|
|
c185c8d9ec | ||
|
|
7636fd6fa8 | ||
|
|
6c48debecd | ||
|
|
3f55eedcf0 | ||
|
|
856c7d5297 | ||
|
|
d7301402c5 | ||
|
|
2a98bfbc8c | ||
|
|
eac923c475 | ||
|
|
6fe0f2d964 | ||
|
|
a4abb0d95f | ||
|
|
c856607f46 | ||
|
|
611f53ef91 | ||
|
|
98afd82d64 | ||
|
|
efae9cacd8 | ||
|
|
5184d1594f | ||
|
|
42e124a90c | ||
|
|
11628ddd93 | ||
|
|
7d5f844fd4 | ||
|
|
f5ff8eb013 | ||
|
|
482487d81c | ||
|
|
2d8b6a29aa | ||
|
|
8f433c11e8 | ||
|
|
9c32a6fdd4 | ||
|
|
bd9676be40 | ||
|
|
392c5d0583 | ||
|
|
14cc4b43df | ||
|
|
de342cb368 | ||
|
|
b68cfab6d8 | ||
|
|
5869571747 | ||
|
|
432cdbcc3a | ||
|
|
438e7b2138 | ||
|
|
a1c45d4fc8 | ||
|
|
66fc278ce9 | ||
|
|
f53dc21475 | ||
|
|
49c438b088 | ||
|
|
5e6ecaf0fa | ||
|
|
47e36f1c3c | ||
|
|
d7a769e397 | ||
|
|
1abb542301 | ||
|
|
afb9474340 | ||
|
|
50ab5f5bdb | ||
|
|
b12151f665 | ||
|
|
8135c68c49 | ||
|
|
5c07ce08bb | ||
|
|
ea16d0ffca | ||
|
|
f590613f83 | ||
|
|
c0878fe66d | ||
|
|
9c18a2ba55 | ||
|
|
0b8a5cb38c | ||
|
|
fde390ac73 | ||
|
|
153213e079 | ||
|
|
35308e41f3 | ||
|
|
931d7e0f30 | ||
|
|
539af1f9b5 | ||
|
|
e052628ed3 | ||
|
|
e52735ae7f | ||
|
|
e539b93de9 | ||
|
|
f952b1c63a | ||
|
|
44c32a06ab | ||
|
|
e1f9e86c56 | ||
|
|
231c4b411f | ||
|
|
9ddaec8add | ||
|
|
e9d65697f3 | ||
|
|
ebb6d7608e | ||
|
|
b849d23f4e | ||
|
|
62d9766ee0 | ||
|
|
e546c05ea0 | ||
|
|
3b7858f96a | ||
|
|
92c4878492 | ||
|
|
e2127038ef | ||
|
|
cea0a72ebc | ||
|
|
3c5dd5f562 | ||
|
|
5bb6b074f0 | ||
|
|
ea217285c0 | ||
|
|
cd4e0ae8de | ||
|
|
c357ca2b7c | ||
|
|
b5a3db860f |
10
.gitignore
vendored
10
.gitignore
vendored
@@ -24,3 +24,13 @@
|
||||
Packaged/*
|
||||
DebugData/*
|
||||
ReleasePkg/*
|
||||
InstallerPackages/*
|
||||
*.msi
|
||||
*.wixpdb
|
||||
*.wixobj
|
||||
*.CopyComplete
|
||||
ReleasePackageInstaller/obj/*
|
||||
ReleasePackageInstaller/bin/*
|
||||
ReleasePackageInstaller/AerofoilPackageDefs.wxi
|
||||
ReleasePackageInstaller/AerofoilPackageVersion.wxi
|
||||
packages/*
|
||||
|
||||
@@ -21,4 +21,16 @@ 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)
|
||||
Distributed under zlib license (See zlib/README)
|
||||
|
||||
|
||||
The Unarchiver:
|
||||
Copyright (C) 2006-2013 Dag Ågren
|
||||
|
||||
Distributed under the LGPLv2 license (See unpacktool/LICENSE.txt)
|
||||
|
||||
|
||||
MACE Audio decoder:
|
||||
Copyright (c) 2002 Laszlo Torok <torokl@alpha.dfmk.hu>
|
||||
|
||||
Distributed under the LGPLv2 license (See macedec.cpp comments)
|
||||
|
||||
121
Aerofoil.sln
121
Aerofoil.sln
@@ -43,92 +43,213 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MakeTimestamp", "MakeTimest
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flattenmov", "flattenmov\flattenmov.vcxproj", "{89F8D13E-F216-4B67-8DE9-7F842D349E94}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unpacktool", "unpacktool\unpacktool.vcxproj", "{A778D062-DE76-49F6-8D05-EB26852DD605}"
|
||||
EndProject
|
||||
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "ReleasePackageInstaller", "ReleasePackageInstaller\ReleasePackageInstaller.wixproj", "{D26BD501-28A7-4849-8130-FB5EA0A2B82F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{7EFF1E21-C375-45EA-A069-4E2232C8A72B} = {7EFF1E21-C375-45EA-A069-4E2232C8A72B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsUnicodeToolShim", "WindowsUnicodeToolShim\WindowsUnicodeToolShim.vcxproj", "{15009625-1120-405E-8BBA-69A16CD6713D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EmitWiXVersion", "EmitWiXVersion\EmitWiXVersion.vcxproj", "{7EFF1E21-C375-45EA-A069-4E2232C8A72B}"
|
||||
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}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{89F8D13E-F216-4B67-8DE9-7F842D349E94}.Debug|x86.Build.0 = Debug|Win32
|
||||
{89F8D13E-F216-4B67-8DE9-7F842D349E94}.Release|x64.ActiveCfg = Release|x64
|
||||
{89F8D13E-F216-4B67-8DE9-7F842D349E94}.Release|x64.Build.0 = Release|x64
|
||||
{89F8D13E-F216-4B67-8DE9-7F842D349E94}.Release|x86.ActiveCfg = Release|Win32
|
||||
{89F8D13E-F216-4B67-8DE9-7F842D349E94}.Release|x86.Build.0 = Release|Win32
|
||||
{A778D062-DE76-49F6-8D05-EB26852DD605}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A778D062-DE76-49F6-8D05-EB26852DD605}.Debug|x64.Build.0 = Debug|x64
|
||||
{A778D062-DE76-49F6-8D05-EB26852DD605}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{A778D062-DE76-49F6-8D05-EB26852DD605}.Debug|x86.Build.0 = Debug|Win32
|
||||
{A778D062-DE76-49F6-8D05-EB26852DD605}.Release|x64.ActiveCfg = Release|x64
|
||||
{A778D062-DE76-49F6-8D05-EB26852DD605}.Release|x64.Build.0 = Release|x64
|
||||
{A778D062-DE76-49F6-8D05-EB26852DD605}.Release|x86.ActiveCfg = Release|Win32
|
||||
{A778D062-DE76-49F6-8D05-EB26852DD605}.Release|x86.Build.0 = Release|Win32
|
||||
{D26BD501-28A7-4849-8130-FB5EA0A2B82F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D26BD501-28A7-4849-8130-FB5EA0A2B82F}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{D26BD501-28A7-4849-8130-FB5EA0A2B82F}.Release|x64.ActiveCfg = Release|x64
|
||||
{D26BD501-28A7-4849-8130-FB5EA0A2B82F}.Release|x86.ActiveCfg = Release|x64
|
||||
{15009625-1120-405E-8BBA-69A16CD6713D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{15009625-1120-405E-8BBA-69A16CD6713D}.Debug|x64.Build.0 = Debug|x64
|
||||
{15009625-1120-405E-8BBA-69A16CD6713D}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{15009625-1120-405E-8BBA-69A16CD6713D}.Debug|x86.Build.0 = Debug|Win32
|
||||
{15009625-1120-405E-8BBA-69A16CD6713D}.Release|x64.ActiveCfg = Release|x64
|
||||
{15009625-1120-405E-8BBA-69A16CD6713D}.Release|x64.Build.0 = Release|x64
|
||||
{15009625-1120-405E-8BBA-69A16CD6713D}.Release|x86.ActiveCfg = Release|Win32
|
||||
{15009625-1120-405E-8BBA-69A16CD6713D}.Release|x86.Build.0 = Release|Win32
|
||||
{7EFF1E21-C375-45EA-A069-4E2232C8A72B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7EFF1E21-C375-45EA-A069-4E2232C8A72B}.Debug|x64.Build.0 = Debug|x64
|
||||
{7EFF1E21-C375-45EA-A069-4E2232C8A72B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{7EFF1E21-C375-45EA-A069-4E2232C8A72B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{7EFF1E21-C375-45EA-A069-4E2232C8A72B}.Release|x64.ActiveCfg = Release|x64
|
||||
{7EFF1E21-C375-45EA-A069-4E2232C8A72B}.Release|x64.Build.0 = Release|x64
|
||||
{7EFF1E21-C375-45EA-A069-4E2232C8A72B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{7EFF1E21-C375-45EA-A069-4E2232C8A72B}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -156,6 +156,7 @@
|
||||
<ClCompile Include="GpFontHandler_FreeType2.cpp" />
|
||||
<ClCompile Include="GpGlobalConfig.cpp" />
|
||||
<ClCompile Include="GpInputDriverFactory.cpp" />
|
||||
<ClCompile Include="GpLogDriver_Win32.cpp" />
|
||||
<ClCompile Include="GpMain.cpp" />
|
||||
<ClCompile Include="GpMain_Win32.cpp" />
|
||||
<ClCompile Include="GpMemoryBuffer.cpp" />
|
||||
@@ -174,14 +175,11 @@
|
||||
<ClInclude Include="..\GpCommon\GpInputDriverProperties.h" />
|
||||
<ClInclude Include="..\GpCommon\IGpCursor.h" />
|
||||
<ClInclude Include="..\GpCommon\IGpAudioChannelCallbacks.h" />
|
||||
<ClInclude Include="..\GpCommon\GpColorCursor_Win32.h" />
|
||||
<ClInclude Include="..\GpCommon\IGpDisplayDriverSurface.h" />
|
||||
<ClInclude Include="..\GpCommon\IGpLogDriver.h" />
|
||||
<ClInclude Include="GpAppEnvironment.h" />
|
||||
<ClInclude Include="GpAudioDriverFactory.h" />
|
||||
<ClInclude Include="GpComPtr.h" />
|
||||
<ClInclude Include="GpCoreDefs.h" />
|
||||
<ClInclude Include="GpDisplayDriverFactory.h" />
|
||||
<ClInclude Include="GpFiber.h" />
|
||||
<ClInclude Include="GpFiber_Win32.h" />
|
||||
<ClInclude Include="GpFileStream_Win32.h" />
|
||||
<ClInclude Include="GpFileSystem_Win32.h" />
|
||||
@@ -189,18 +187,14 @@
|
||||
<ClInclude Include="GpFontHandlerFactory.h" />
|
||||
<ClInclude Include="GpGlobalConfig.h" />
|
||||
<ClInclude Include="GpInputDriverFactory.h" />
|
||||
<ClInclude Include="GpLogDriver_Win32.h" />
|
||||
<ClInclude Include="GpMain.h" />
|
||||
<ClInclude Include="GpMemoryBuffer.h" />
|
||||
<ClInclude Include="GpMutex_Win32.h" />
|
||||
<ClInclude Include="GpRingBuffer.h" />
|
||||
<ClInclude Include="GpSystemServices_Win32.h" />
|
||||
<ClInclude Include="GpFiberStarter.h" />
|
||||
<ClInclude Include="GpThreadEvent_Win32.h" />
|
||||
<ClInclude Include="GpVOSEventQueue.h" />
|
||||
<ClInclude Include="GpWindows.h" />
|
||||
<ClInclude Include="IGpAudioChannel.h" />
|
||||
<ClInclude Include="IGpAudioDriver.h" />
|
||||
<ClInclude Include="IGpDisplayDriver.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
178
Aerofoil/Aerofoil.vcxproj.filters
Normal file
178
Aerofoil/Aerofoil.vcxproj.filters
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="GpVOSEventQueue.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpAppEnvironment.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpAudioDriverFactory.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpColorCursor_Win32.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpDisplayDriverFactory.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpFiber_Win32.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpFiberStarter_Win32.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpFileStream_Win32.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpFileSystem_Win32.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpFontHandler_FreeType2.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpFontHandlerFactory.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpGlobalConfig.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpInputDriverFactory.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpMain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpMain_Win32.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpMemoryBuffer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpMutex_Win32.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpSystemServices_Win32.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpThreadEvent_Win32.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GpLogDriver_Win32.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\GpCommon\EGpInputDriverType.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\GpCommon\EGpStandardCursor.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpAppEnvironment.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\GpCommon\GpApplicationName.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpAudioDriverFactory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpDisplayDriverFactory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\GpCommon\GpDisplayDriverTickStatus.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpFiber_Win32.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpFiberStarter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\GpCommon\GpFileCreationDisposition.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpFileStream_Win32.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpFileSystem_Win32.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpFontHandler_FreeType2.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpFontHandlerFactory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpGlobalConfig.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpInputDriverFactory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\GpCommon\GpInputDriverProperties.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpMain.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpMemoryBuffer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpMutex_Win32.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpSystemServices_Win32.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpThreadEvent_Win32.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpVOSEventQueue.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\GpCommon\IGpAudioChannelCallbacks.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\GpCommon\IGpCursor.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\GpCommon\IGpDisplayDriverSurface.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\GpCommon\IGpLogDriver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GpLogDriver_Win32.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="ConvertedResources\Large128.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
<Image Include="ConvertedResources\Small128.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{0db467fa-83af-4c89-b36b-2478899f4f9e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{bdb8c57b-c9f7-443a-be30-89718b8ca3e5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{8ed8ebed-2aea-4f6d-8f2f-c18a64eb6e20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Aerofoil.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -142,3 +142,8 @@ void GpFileStream_Win32::Close()
|
||||
{
|
||||
CloseHandle(m_handle);
|
||||
}
|
||||
|
||||
void GpFileStream_Win32::Flush()
|
||||
{
|
||||
FlushFileBuffers(m_handle);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ public:
|
||||
bool Truncate(PortabilityLayer::UFilePos_t loc) override;
|
||||
PortabilityLayer::UFilePos_t Size() const override;
|
||||
PortabilityLayer::UFilePos_t Tell() const override;
|
||||
void Close() override;
|
||||
void Close() override;
|
||||
void Flush() override;
|
||||
|
||||
private:
|
||||
HANDLE m_handle;
|
||||
|
||||
@@ -122,16 +122,19 @@ GpFileSystem_Win32::GpFileSystem_Win32()
|
||||
m_userHousesDir = m_prefsDir + L"\\Houses";
|
||||
m_userSavesDir = m_prefsDir + L"\\SavedGames";
|
||||
m_scoresDir = m_prefsDir + L"\\Scores";
|
||||
m_logsDir = m_prefsDir + L"\\Logs";
|
||||
|
||||
CreateDirectoryW(m_prefsDir.c_str(), nullptr);
|
||||
CreateDirectoryW(m_scoresDir.c_str(), nullptr);
|
||||
CreateDirectoryW(m_userHousesDir.c_str(), nullptr);
|
||||
CreateDirectoryW(m_userSavesDir.c_str(), nullptr);
|
||||
CreateDirectoryW(m_logsDir.c_str(), nullptr);
|
||||
|
||||
m_prefsDir.append(L"\\");
|
||||
m_scoresDir.append(L"\\");
|
||||
m_userHousesDir.append(L"\\");
|
||||
m_userSavesDir.append(L"\\");
|
||||
m_logsDir.append(L"\\");
|
||||
}
|
||||
|
||||
DWORD modulePathSize = GetModuleFileNameW(nullptr, m_executablePath, MAX_PATH);
|
||||
@@ -514,6 +517,9 @@ bool GpFileSystem_Win32::ResolvePath(PortabilityLayer::VirtualDirectory_t virtua
|
||||
case PortabilityLayer::VirtualDirectories::kHighScores:
|
||||
baseDir = m_scoresDir.c_str();
|
||||
break;
|
||||
case PortabilityLayer::VirtualDirectories::kLogs:
|
||||
baseDir = m_logsDir.c_str();
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ private:
|
||||
std::wstring m_scoresDir;
|
||||
std::wstring m_packagedDir;
|
||||
std::wstring m_housesDir;
|
||||
std::wstring m_logsDir;
|
||||
std::wstring m_userHousesDir;
|
||||
std::wstring m_userSavesDir;
|
||||
std::wstring m_resourcesDir;
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
#include "EGpDisplayDriverType.h"
|
||||
#include "EGpAudioDriverType.h"
|
||||
#include "EGpInputDriverType.h"
|
||||
#include "EGpInputDriverType.h"
|
||||
|
||||
struct IGpLogDriver;
|
||||
|
||||
struct GpGlobalConfig
|
||||
{
|
||||
@@ -11,6 +13,7 @@ struct GpGlobalConfig
|
||||
const EGpInputDriverType *m_inputDriverTypes;
|
||||
size_t m_numInputDrivers;
|
||||
|
||||
IGpLogDriver *m_logger;
|
||||
void *m_osGlobals;
|
||||
};
|
||||
|
||||
|
||||
113
Aerofoil/GpLogDriver_Win32.cpp
Normal file
113
Aerofoil/GpLogDriver_Win32.cpp
Normal file
@@ -0,0 +1,113 @@
|
||||
#include "GpLogDriver_Win32.h"
|
||||
#include "GpFileSystem_Win32.h"
|
||||
|
||||
#include "GpApplicationName.h"
|
||||
#include "IOStream.h"
|
||||
|
||||
GpLogDriver_Win32::GpLogDriver_Win32()
|
||||
: m_stream(nullptr)
|
||||
, m_isInitialized(false)
|
||||
{
|
||||
}
|
||||
|
||||
void GpLogDriver_Win32::Init()
|
||||
{
|
||||
ms_instance.InitInternal();
|
||||
}
|
||||
|
||||
void GpLogDriver_Win32::VPrintf(Category category, const char *fmt, va_list args)
|
||||
{
|
||||
size_t fmtSize = 0;
|
||||
bool hasFormatting = false;
|
||||
for (const char *fmtCheck = fmt; *fmtCheck; fmtCheck++)
|
||||
{
|
||||
if (*fmtCheck == '%')
|
||||
hasFormatting = true;
|
||||
|
||||
fmtSize++;
|
||||
}
|
||||
|
||||
SYSTEMTIME sysTime;
|
||||
GetSystemTime(&sysTime);
|
||||
|
||||
char timestampBuffer[64];
|
||||
sprintf(timestampBuffer, "[%02d:%02d:%02d:%03d] ", sysTime.wHour, sysTime.wMinute, sysTime.wSecond, sysTime.wMilliseconds);
|
||||
|
||||
m_stream->Write(timestampBuffer, strlen(timestampBuffer));
|
||||
|
||||
const char *debugTag = "";
|
||||
|
||||
switch (category)
|
||||
{
|
||||
case Category_Warning:
|
||||
debugTag = "[WARNING] ";
|
||||
break;
|
||||
case Category_Error:
|
||||
debugTag = "[ERROR] ";
|
||||
break;
|
||||
};
|
||||
|
||||
if (debugTag[0])
|
||||
m_stream->Write(debugTag, strlen(debugTag));
|
||||
|
||||
if (!hasFormatting)
|
||||
m_stream->Write(fmt, fmtSize);
|
||||
else
|
||||
{
|
||||
int formattedSize = vsnprintf(nullptr, 0, fmt, args);
|
||||
if (formattedSize <= 0)
|
||||
return;
|
||||
|
||||
char *charBuff = static_cast<char*>(malloc(formattedSize + 1));
|
||||
if (!charBuff)
|
||||
return;
|
||||
|
||||
vsnprintf(charBuff, formattedSize + 1, fmt, args);
|
||||
|
||||
m_stream->Write(charBuff, formattedSize);
|
||||
free(charBuff);
|
||||
}
|
||||
|
||||
m_stream->Write("\n", 1);
|
||||
|
||||
m_stream->Flush();
|
||||
}
|
||||
|
||||
void GpLogDriver_Win32::Shutdown()
|
||||
{
|
||||
if (m_stream)
|
||||
m_stream->Close();
|
||||
}
|
||||
|
||||
GpLogDriver_Win32 *GpLogDriver_Win32::GetInstance()
|
||||
{
|
||||
if (ms_instance.m_isInitialized)
|
||||
return &ms_instance;
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void GpLogDriver_Win32::InitInternal()
|
||||
{
|
||||
SYSTEMTIME utcTime;
|
||||
GetSystemTime(&utcTime);
|
||||
|
||||
char logFileName[256];
|
||||
|
||||
sprintf(logFileName, GP_APPLICATION_NAME "-%04d-%02d-%02d_%02d-%02d_%02d.txt", utcTime.wYear, utcTime.wMonth, utcTime.wDay, utcTime.wHour, utcTime.wMinute, utcTime.wSecond);
|
||||
|
||||
m_stream = GpFileSystem_Win32::GetInstance()->OpenFile(PortabilityLayer::VirtualDirectories::kLogs, logFileName, true, GpFileCreationDispositions::kCreateOrOverwrite);
|
||||
if (m_stream)
|
||||
{
|
||||
this->Printf(IGpLogDriver::Category_Information, GP_APPLICATION_NAME " build " __TIMESTAMP__);
|
||||
#ifdef NDEBUG
|
||||
this->Printf(IGpLogDriver::Category_Information, "Configuration: Release");
|
||||
#else
|
||||
this->Printf(IGpLogDriver::Category_Information, "Configuration: Debug");
|
||||
#endif
|
||||
|
||||
m_isInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
GpLogDriver_Win32 GpLogDriver_Win32::ms_instance;
|
||||
29
Aerofoil/GpLogDriver_Win32.h
Normal file
29
Aerofoil/GpLogDriver_Win32.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include "IGpLogDriver.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
}
|
||||
|
||||
class GpLogDriver_Win32 : public IGpLogDriver
|
||||
{
|
||||
public:
|
||||
GpLogDriver_Win32();
|
||||
|
||||
static void Init();
|
||||
|
||||
void VPrintf(Category category, const char *fmt, va_list args) override;
|
||||
void Shutdown() override;
|
||||
|
||||
static GpLogDriver_Win32 *GetInstance();
|
||||
|
||||
private:
|
||||
void InitInternal();
|
||||
|
||||
PortabilityLayer::IOStream *m_stream;
|
||||
bool m_isInitialized;
|
||||
|
||||
static GpLogDriver_Win32 ms_instance;
|
||||
};
|
||||
@@ -63,6 +63,7 @@ int GpMain::Run()
|
||||
ddProps.m_type = g_gpGlobalConfig.m_displayDriverType;
|
||||
ddProps.m_osGlobals = g_gpGlobalConfig.m_osGlobals;
|
||||
ddProps.m_eventQueue = eventQueue;
|
||||
ddProps.m_logger = g_gpGlobalConfig.m_logger;
|
||||
|
||||
GpAudioDriverProperties adProps;
|
||||
memset(&adProps, 0, sizeof(adProps));
|
||||
@@ -72,10 +73,11 @@ int GpMain::Run()
|
||||
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;
|
||||
#else
|
||||
adProps.m_debug = true;
|
||||
#endif
|
||||
adProps.m_logger = g_gpGlobalConfig.m_logger;
|
||||
|
||||
IGpInputDriver **inputDrivers = static_cast<IGpInputDriver**>(malloc(sizeof(IGpInputDriver*) * g_gpGlobalConfig.m_numInputDrivers));
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "GpGlobalConfig.h"
|
||||
#include "GpFiber_Win32.h"
|
||||
#include "GpFileSystem_Win32.h"
|
||||
#include "GpLogDriver_Win32.h"
|
||||
#include "GpInputDriverFactory.h"
|
||||
#include "GpAppInterface.h"
|
||||
#include "GpSystemServices_Win32.h"
|
||||
@@ -15,6 +16,9 @@
|
||||
|
||||
#include "GpWindows.h"
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
#include <shellapi.h>
|
||||
#include <stdio.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
@@ -392,15 +396,33 @@ static void TranslateWindowsMessage(const MSG *msg, IGpVOSEventQueue *eventQueue
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
LPWSTR cmdLine = GetCommandLineW();
|
||||
|
||||
int nArgs;
|
||||
LPWSTR *cmdLineArgs = CommandLineToArgvW(cmdLine, &nArgs);
|
||||
|
||||
for (int i = 1; i < nArgs; i++)
|
||||
{
|
||||
if (!wcscmp(cmdLineArgs[i], L"-diagnostics"))
|
||||
GpLogDriver_Win32::Init();
|
||||
}
|
||||
|
||||
IGpLogDriver *logger = GpLogDriver_Win32::GetInstance();
|
||||
|
||||
GpAppInterface_Get()->PL_HostFileSystem_SetInstance(GpFileSystem_Win32::GetInstance());
|
||||
GpAppInterface_Get()->PL_HostSystemServices_SetInstance(GpSystemServices_Win32::GetInstance());
|
||||
GpAppInterface_Get()->PL_HostLogDriver_SetInstance(GpLogDriver_Win32::GetInstance());
|
||||
|
||||
g_gpWindowsGlobals.m_hInstance = hInstance;
|
||||
g_gpWindowsGlobals.m_hPrevInstance = hPrevInstance;
|
||||
g_gpWindowsGlobals.m_cmdLine = lpCmdLine;
|
||||
g_gpWindowsGlobals.m_cmdLine = cmdLine;
|
||||
g_gpWindowsGlobals.m_cmdLineArgc = nArgs;
|
||||
g_gpWindowsGlobals.m_cmdLineArgv = cmdLineArgs;
|
||||
g_gpWindowsGlobals.m_nCmdShow = nCmdShow;
|
||||
g_gpWindowsGlobals.m_baseDir = GpFileSystem_Win32::GetInstance()->GetBasePath();
|
||||
g_gpWindowsGlobals.m_hwnd = nullptr;
|
||||
g_gpWindowsGlobals.m_hIcon = LoadIconW(hInstance, MAKEINTRESOURCEW(IDI_ICON1));
|
||||
g_gpWindowsGlobals.m_hIconSm = LoadIconW(hInstance, MAKEINTRESOURCEW(IDI_ICON2));
|
||||
|
||||
g_gpWindowsGlobals.m_createFiberFunc = GpFiber_Win32::Create;
|
||||
g_gpWindowsGlobals.m_loadCursorFunc = GpCursor_Win32::Load;
|
||||
@@ -418,10 +440,21 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
g_gpGlobalConfig.m_numInputDrivers = sizeof(inputDrivers) / sizeof(inputDrivers[0]);
|
||||
|
||||
g_gpGlobalConfig.m_osGlobals = &g_gpWindowsGlobals;
|
||||
g_gpGlobalConfig.m_logger = logger;
|
||||
|
||||
GpDisplayDriverFactory::RegisterDisplayDriverFactory(EGpDisplayDriverType_D3D11, GpDriver_CreateDisplayDriver_D3D11);
|
||||
GpAudioDriverFactory::RegisterAudioDriverFactory(EGpAudioDriverType_XAudio2, GpDriver_CreateAudioDriver_XAudio2);
|
||||
GpInputDriverFactory::RegisterInputDriverFactory(EGpInputDriverType_XInput, GpDriver_CreateInputDriver_XInput);
|
||||
|
||||
return GpMain::Run();
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "Windows environment configured, starting up");
|
||||
|
||||
int returnCode = GpMain::Run();
|
||||
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "Windows environment exited with code %i, cleaning up", returnCode);
|
||||
|
||||
LocalFree(cmdLineArgs);
|
||||
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
13
ApplicationResourcePatches/DITL/2000.json
Normal file
13
ApplicationResourcePatches/DITL/2000.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"items" :
|
||||
[
|
||||
{
|
||||
"name" : "Okay",
|
||||
"itemType" : "Button",
|
||||
"pos" : [ 376, 240 ],
|
||||
"size" : [ 58, 20 ],
|
||||
"id" : 1,
|
||||
"enabled" : true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"add" :
|
||||
{
|
||||
"DITL/1017.json" : "ApplicationResourcePatches/DITL/1017.json"
|
||||
"DITL/1017.json" : "ApplicationResourcePatches/DITL/1017.json",
|
||||
"DITL/2000.json" : "ApplicationResourcePatches/DITL/2000.json"
|
||||
},
|
||||
"delete" :
|
||||
[
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
|
||||
@@ -52,6 +52,14 @@ const CompileJob kCompileJobs[] =
|
||||
drawQuadDefs,
|
||||
"PSMain",
|
||||
"ps_4_0"
|
||||
},
|
||||
{
|
||||
L"ShaderSrc\\ScaleQuadP.hlsl",
|
||||
L"GpDisplayDriver_D3D11\\CompiledShaders\\ScaleQuadP_D3D11.cpp",
|
||||
"g_scaleQuadP_D3D11",
|
||||
drawQuadDefs,
|
||||
"PSMain",
|
||||
"ps_4_0"
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
rmdir /S /Q Packaged
|
||||
|
||||
mkdir Packaged
|
||||
mkdir Packaged\Houses
|
||||
mkdir Packaged\WinCursors
|
||||
|
||||
28
Documentation/picterrors.txt
Normal file
28
Documentation/picterrors.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
Many Glider PRO houses, including the bundled ones, contain images in QuickDraw
|
||||
PICT format in the game resource data.
|
||||
|
||||
PICT is a very complex format, many of its features are not completely
|
||||
documented, and some PICT features are impossible to support because they
|
||||
require copyrighted pattern sets and fonts that are bundled with the
|
||||
operating system.
|
||||
|
||||
My goal is to support as many community houses as possible, but there is a
|
||||
point where supporting the format is more work than just manually converting
|
||||
the resources on a Macintosh machine or emulator.
|
||||
|
||||
All of the remaining known unsupported features necessary to decode the
|
||||
remaining cases are only used by one house that I'm aware of each.
|
||||
|
||||
Known error codes:
|
||||
|
||||
Code 5 subcode 25: Strange image channel layout
|
||||
Code 8 subcode 145: Unsupported BitsRgn opcode.
|
||||
Code 8 subcode 40960: Undocumented opcode, possibly a format parsing error.
|
||||
|
||||
Code 8 subcode 34: Unsupported ShortLine opcode. (PICT contains vector graphics.)
|
||||
Code 8 subcode 35: Unsupported ShortLineFrom opcode. (PICT contains vector graphics.)
|
||||
Code 8 subcode 49: Unsupported PaintRect opcode. (PICT contains vector graphics.)
|
||||
Code 8 subcode 51: Unsupported PaintOval opcode. (PICT contains vector graphics.)
|
||||
Code 8 subcode 129: paintRgn opcode. (PICT contains vector graphics.)
|
||||
Code 8 subcode 33280: Unsupported CompressedQuickTime opcode. (PICT contains a QuickTime frame.)
|
||||
Code 8 subcode 33281: Unsupported UncompressedQuickTime opcode. (PICT contains a QuickTime frame.)
|
||||
@@ -1,55 +1,57 @@
|
||||
Aerofoil is a third-party port of Glider PRO
|
||||
Thank you for trying Aerofoil!
|
||||
|
||||
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.
|
||||
IMPORTANT: 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:
|
||||
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.
|
||||
IN-GAME SHORTCUT COMMANDS
|
||||
-------------------------------------------------------------------------------
|
||||
- Ctrl-S saves the game. You can reload a saved game from the main menu.
|
||||
- Ctrl-Q quits the game.
|
||||
- Alt-Enter toggles full screen.
|
||||
|
||||
|
||||
GAMEPAD SUPPORT
|
||||
-------------------------------------------------------------------------------
|
||||
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)
|
||||
|
||||
|
||||
LEGAL NOTICES
|
||||
-------------------------------------------------------------------------------
|
||||
Aerofoil is (c)2019-2020 Eric Lasota
|
||||
Based on Glider PRO (c)1994-2000 Casady & Greene, Inc., written by John Calhoun
|
||||
Distributed under the terms of the GNU General Public License version 2 (see license_gplv2.txt)
|
||||
|
||||
|
||||
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
|
||||
@@ -74,9 +76,25 @@ zlib:
|
||||
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.
|
||||
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)
|
||||
|
||||
|
||||
The Unarchiver:
|
||||
|
||||
The "unpacktool" utility is heavily based on code from The Unarchiver.
|
||||
Copyright (C) 2006-2013 Dag Ågren
|
||||
|
||||
Distributed under the LGPLv2 license (See license_lgplv2.txt)
|
||||
|
||||
|
||||
FFmpeg:
|
||||
|
||||
The "gpr2gpa" tool uses MACE decompression code from FFmpeg.
|
||||
Copyright (c) 2002 Laszlo Torok <torokl@alpha.dfmk.hu>
|
||||
|
||||
Distributed under the LGPLv2 license (See license_lgplv2.txt)
|
||||
|
||||
@@ -1,16 +1,84 @@
|
||||
If you want to import an existing third-party Glider PRO house to Aerofoil, a few steps are required.
|
||||
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.
|
||||
You need to convert the file into Aerofoil's "triplet" format, which consists
|
||||
of a metadata file (extension .gpf), and file forks (.gpd for data, .gpr for
|
||||
resources). How you get these depends on the input format:
|
||||
- For MacBinary files (.bin), use the "bin2gp" utility
|
||||
- For BinHex files (.hqx), use the "hqx2gp" utility
|
||||
- For StuffIt (.sit) and Compact Pro (.cpt) archives, use the "unpacktool"
|
||||
utility to extract the contents in triplet format. The "unpacktool"
|
||||
utility should support most vintage StuffIt archives made with StuffIt
|
||||
Deluxe 6 or lower.
|
||||
|
||||
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.
|
||||
(NOTE: ".sea" files are self-extracting archives, typically StuffIt or Compact
|
||||
Pro archives with the self-extractor program in the resources. These will
|
||||
always be distributed in a fork-grouping container like MacBinary or BinHex.
|
||||
For cases like these, you need to split the self-extracting archive using
|
||||
"bin2gp" or "hqx2gp" and then pass the ".sea.gpd" file (which contains the
|
||||
archive data) to "unpacktool" to decompress it.)
|
||||
|
||||
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.
|
||||
Once you've done that, if the house has custom resources (i.e. a .gpr file),
|
||||
you need to convert it to an Aerofoil resource archive, which you can do using
|
||||
the "gpr2gpa" tool.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
Converting QuickTime movies for displaying on in-game TVs is a bit more complex.
|
||||
First, you need to convert the movie to a sequence of BMP images, which you
|
||||
can do with third-party tools such as FFMPEG. Second, you need to create a
|
||||
JSON file containing the movie metadata, which looks like this, for example:
|
||||
|
||||
{
|
||||
"frameRateNumerator" : 8,
|
||||
"frameRateDenominator" : 1
|
||||
}
|
||||
|
||||
Once you've done that, create a ZIP archive where the path of the JSON file is
|
||||
"muvi\0.json" and the frames are "PICT\<frame number>.bmp", where <frame
|
||||
number> is the frame number, starting with 1 as the first frame, and name that
|
||||
the same as the house name, but with a ".mov.gpa" extension.
|
||||
|
||||
Next, you need to create a metadata file for the movie, which should have a
|
||||
".mov.gpf" extension. You can create the metadata file using the "FTagData"
|
||||
utility, using a timestamp file created with the "MakeTimestamp" utility.
|
||||
I'd recommend using "MooV" as the file type and "ozm5" as the file creator.
|
||||
|
||||
You do NOT need to keep the .mov.gpd file once you've done this - Aerofoil
|
||||
expects all of the movie data to be in the resource archive.
|
||||
|
||||
|
||||
Some old QuickTime movies contain movie tracking information in the movie
|
||||
resource fork, in which case you need to merge them into the data for modern
|
||||
utilities to read them. You can use the "flattenmov" tool to do this: Pass
|
||||
it the data (.gpd) and resource (.gpr) data files for a movie, and it will
|
||||
merge them into a single .mov file.
|
||||
|
||||
|
||||
BATCH CONVERSION
|
||||
------------------------------------------------------------------------------
|
||||
To batch-convert house resource files, use gpr2gpa with a path that ends
|
||||
with an asterisk (*) and omit the output filename.
|
||||
|
||||
|
||||
SECURITY CONSIDERATIONS
|
||||
------------------------------------------------------------------------------
|
||||
Glider PRO didn't really do any validation of houses. Currently, Aerofoil
|
||||
doesn't do any additional validation either, and it's possible that invalid
|
||||
house data may lead to crashes or even remote code execution.
|
||||
|
||||
I will be doing a hardening pass on the loader for the 1.1 release. Until
|
||||
then, please only load houses from trusted sources.
|
||||
|
||||
Also, Glider PRO houses were able to take advantage of a resource overlaying
|
||||
feature of the Macintosh operating system, where a resource being present in
|
||||
the house file with the same ID as an application resource would cause the
|
||||
resource to override the application resource.
|
||||
|
||||
Aerofoil's resource loader is much more restrictive: Currently, only
|
||||
backgrounds, audio triggers, and icons may load from the house data. This
|
||||
restriction will be loosened in the 1.1 release to allow resources to be
|
||||
overrided if I can confirm that it's safe to override them.
|
||||
27
EmitWiXVersion/EmitWiXVersion.cpp
Normal file
27
EmitWiXVersion/EmitWiXVersion.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "GpBuildVersion.h"
|
||||
#include "WindowsUnicodeToolShim.h"
|
||||
|
||||
|
||||
int toolMain(int argc, const char **argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
{
|
||||
fprintf(stderr, "Usage: EmitWiXVersion <output>\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
FILE *f = fopen_utf8(argv[1], "wb");
|
||||
if (!f)
|
||||
{
|
||||
fprintf(stderr, "EmitWiXVersion: Error opening output file\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
fprintf(f, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
||||
fprintf(f, "<Include>\n");
|
||||
fprintf(f, " <?define AerofoilReleaseVersion=\"%i.%i.%i.0\" ?>\n", GP_BUILD_VERSION_MAJOR, GP_BUILD_VERSION_MINOR, GP_BUILD_VERSION_UPDATE);
|
||||
fprintf(f, "</Include>\n");
|
||||
fclose(f);
|
||||
|
||||
return 0;
|
||||
}
|
||||
139
EmitWiXVersion/EmitWiXVersion.vcxproj
Normal file
139
EmitWiXVersion/EmitWiXVersion.vcxproj
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{7EFF1E21-C375-45EA-A069-4E2232C8A72B}</ProjectGuid>
|
||||
<RootNamespace>EmitWiXVersion</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
<Import Project="..\WindowsUnicodeToolShim.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
<Import Project="..\WindowsUnicodeToolShim.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
<Import Project="..\WindowsUnicodeToolShim.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
<Import Project="..\WindowsUnicodeToolShim.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="EmitWiXVersion.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PortabilityLayer\PortabilityLayer.vcxproj">
|
||||
<Project>{6ec62b0f-9353-40a4-a510-3788f1368b33}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WindowsUnicodeToolShim\WindowsUnicodeToolShim.vcxproj">
|
||||
<Project>{15009625-1120-405e-8bba-69a16cd6713d}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
22
EmitWiXVersion/EmitWiXVersion.vcxproj.filters
Normal file
22
EmitWiXVersion/EmitWiXVersion.vcxproj.filters
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="EmitWiXVersion.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
113
GpApp/About.cpp
113
GpApp/About.cpp
@@ -7,10 +7,14 @@
|
||||
#include "PLArrayView.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLControlDefinitions.h"
|
||||
#include "FontFamily.h"
|
||||
#include "PLButtonWidget.h"
|
||||
#include "PLLabelWidget.h"
|
||||
#include "PLNumberFormatting.h"
|
||||
#include "PLResources.h"
|
||||
#include "PLSound.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "PLSysCalls.h"
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
#include "PLWidgets.h"
|
||||
@@ -19,15 +23,23 @@
|
||||
#include "DialogUtils.h"
|
||||
#include "Environ.h"
|
||||
#include "Externs.h"
|
||||
#include "GpApplicationName.h"
|
||||
#include "GpBuildVersion.h"
|
||||
#include "HostSystemServices.h"
|
||||
#include "RenderedFont.h"
|
||||
#include "RenderedFontMetrics.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "ScanlineMask.h"
|
||||
#include "WindowDef.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
|
||||
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 AboutFrameworkFilter(Dialog *, const TimeTaggedVOSEvent *evt);
|
||||
|
||||
|
||||
static Point okayButtLowerV, okayButtUpperV;
|
||||
@@ -86,6 +98,66 @@ void DoAbout (void)
|
||||
aboutDialog->Destroy();
|
||||
}
|
||||
|
||||
void DoAboutFramework (void)
|
||||
{
|
||||
#define kAboutFrameworkDialogTemplateID 2000
|
||||
|
||||
const Rect windowRect = Rect::Create(0, 0, 272, 450);
|
||||
|
||||
PortabilityLayer::WindowDef wdef = PortabilityLayer::WindowDef::Create(windowRect, PortabilityLayer::WindowStyleFlags::kAlert, true, 0, 0, PSTR(""));
|
||||
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
PortabilityLayer::RenderedFont *font = GetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
PortabilityLayer::RenderedFont *fontLight = GetApplicationFont(8, PortabilityLayer::FontFamilyFlag_None, true);
|
||||
|
||||
int16_t verticalPoint = 16 + font->GetMetrics().m_ascent;
|
||||
int16_t horizontalOffset = 16;
|
||||
const int16_t spacing = 12;
|
||||
|
||||
PortabilityLayer::DialogManager *dialogManager = PortabilityLayer::DialogManager::GetInstance();
|
||||
Dialog *dialog = dialogManager->LoadDialogFromTemplate(kAboutFrameworkDialogTemplateID, windowRect, true, false, 0, 0, PL_GetPutInFrontWindowPtr(), PSTR(""), nullptr);
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define ABOUT_DIALOG_CONFIGURATION_TAG "Release"
|
||||
#else
|
||||
#define ABOUT_DIALOG_CONFIGURATION_TAG "Debug"
|
||||
#endif
|
||||
|
||||
Window *window = dialog->GetWindow();
|
||||
|
||||
DrawSurface *surface = window->GetDrawSurface();
|
||||
surface->DrawString(Point::Create(horizontalOffset, verticalPoint + spacing * 0), PSTR(GP_APPLICATION_NAME " " GP_APPLICATION_VERSION_STRING " \xa9" GP_APPLICATION_COPYRIGHT_STRING), blackColor, font);
|
||||
|
||||
surface->DrawString(Point::Create(horizontalOffset, verticalPoint + spacing * 2), PSTR(GP_APPLICATION_NAME " is an unoffical third-party port of Glider PRO\xaa."), blackColor, font);
|
||||
|
||||
surface->DrawString(Point::Create(horizontalOffset, verticalPoint + spacing * 4), PSTR("This software is not maintained by, supported by, endorsed by, or"), blackColor, font);
|
||||
surface->DrawString(Point::Create(horizontalOffset, verticalPoint + spacing * 5), PSTR("otherwise associated with the authors and publishers of Glider PRO\xaa."), blackColor, font);
|
||||
|
||||
surface->DrawString(Point::Create(horizontalOffset, verticalPoint + spacing * 7), PSTR("Please do not contact any of them regarding issues that you have"), blackColor, font);
|
||||
surface->DrawString(Point::Create(horizontalOffset, verticalPoint + spacing * 8), PSTR("with " GP_APPLICATION_NAME "."), blackColor, font);
|
||||
|
||||
surface->DrawString(Point::Create(horizontalOffset, verticalPoint + spacing * 10), PSTR("If you would like to contribute to this project, visit:"), blackColor, font);
|
||||
surface->DrawString(Point::Create(horizontalOffset, verticalPoint + spacing * 11), PSTR(GP_APPLICATION_WEBSITE_STRING), blackColor, font);
|
||||
|
||||
surface->DrawString(Point::Create(horizontalOffset, verticalPoint + spacing * 13), PSTR("To report a problem or request support, submit an issue via"), blackColor, font);
|
||||
surface->DrawString(Point::Create(horizontalOffset, verticalPoint + spacing * 14), PSTR("the website above."), blackColor, font);
|
||||
|
||||
surface->DrawString(Point::Create(horizontalOffset, verticalPoint + spacing * 16), PSTR("For more information, please see the accompanying documentation."), blackColor, font);
|
||||
|
||||
surface->DrawString(Point::Create(horizontalOffset, windowRect.bottom - 16), PSTR("Build: " __DATE__ " " __TIME__ " " ABOUT_DIALOG_CONFIGURATION_TAG), blackColor, fontLight);
|
||||
|
||||
DrawDefaultButton(dialog);
|
||||
|
||||
int16_t hit = 0;
|
||||
|
||||
do
|
||||
{
|
||||
hit = dialog->ExecuteModal(AboutFrameworkFilter);
|
||||
} while (hit != kOkayButton);
|
||||
|
||||
dialog->Destroy();
|
||||
}
|
||||
|
||||
//============================================================== Static Functions
|
||||
//-------------------------------------------------------------- HiLiteOkayButton
|
||||
// Draws my pseudo-button to appear as though it is clicked on.
|
||||
@@ -253,3 +325,44 @@ static int16_t AboutFilter(Dialog *dialog, const TimeTaggedVOSEvent *evt)
|
||||
return hit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------- AboutFrameworkFilter
|
||||
// Dialog filter for the About Framework dialog.
|
||||
|
||||
static int16_t AboutFrameworkFilter(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())
|
||||
{
|
||||
switch (PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent))
|
||||
{
|
||||
case PL_KEY_SPECIAL(kEnter):
|
||||
case PL_KEY_NUMPAD_SPECIAL(kEnter):
|
||||
dialog->GetItems()[kOkayButton - 1].GetWidget()->SetHighlightStyle(kControlButtonPart, true);
|
||||
PLSysCalls::Sleep(8);
|
||||
dialog->GetItems()[kOkayButton - 1].GetWidget()->SetHighlightStyle(kControlButtonPart, false);
|
||||
hit = kOkayButton;
|
||||
handledIt = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
handledIt = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!handledIt)
|
||||
return -1;
|
||||
|
||||
return hit;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
//============================================================================
|
||||
|
||||
|
||||
#include "PLAppleEvents.h"
|
||||
#include "AppEventHandler.h"
|
||||
#include "DialogManager.h"
|
||||
#include "Externs.h"
|
||||
@@ -15,6 +14,9 @@
|
||||
|
||||
#define kNoPrintingAlert 1031
|
||||
|
||||
extern Boolean quitting;
|
||||
|
||||
#if 0
|
||||
|
||||
PLError_t DoOpenAppAE (const AppleEvent *, AppleEvent *, UInt32);
|
||||
PLError_t DoOpenDocAE (const AppleEvent *, AppleEvent *, UInt32);
|
||||
@@ -28,7 +30,6 @@ AEEventHandlerUPP openAppAEUPP, openDocAEUPP, printDocAEUPP, quitAEUPP;
|
||||
extern VFileSpec *theHousesSpecs;
|
||||
extern long incrementModeTime;
|
||||
extern short thisHouseIndex, splashOriginH, splashOriginV;
|
||||
extern Boolean quitting;
|
||||
|
||||
|
||||
//============================================================== Functions
|
||||
@@ -52,7 +53,7 @@ PLError_t DoOpenDocAE (const AppleEvent *theAE, AppleEvent *reply, UInt32 ref)
|
||||
VFileInfo finderInfo;
|
||||
AEDescList docList;
|
||||
long itemsInList;
|
||||
Size actualSize;
|
||||
size_t actualSize;
|
||||
AEKeyword keywd;
|
||||
DescType returnedType;
|
||||
PLError_t theErr, whoCares;
|
||||
@@ -162,12 +163,13 @@ PLError_t DoQuitAE (const AppleEvent *theAE, AppleEvent *reply, UInt32 ref)
|
||||
PLError_t MyGotRequiredParams (const AppleEvent *theAE)
|
||||
{
|
||||
DescType returnedType;
|
||||
Size actualSize;
|
||||
size_t actualSize;
|
||||
|
||||
return (AEGetAttributePtr(theAE, keyMissedKeywordAttr, typeWildCard,
|
||||
&returnedType, 0L, 0, &actualSize) == errAEDescNotFound) ? PLErrors::kNone :
|
||||
PLErrors::kInvalidParameter;
|
||||
}
|
||||
#endif
|
||||
|
||||
class SystemEventHandlerImpl : public PortabilityLayer::IAppEventHandler
|
||||
{
|
||||
@@ -201,34 +203,5 @@ void SetUpAppleEvents (void)
|
||||
PLError_t theErr;
|
||||
|
||||
PortabilityLayer::AppEventHandler::SetInstance(SystemEventHandlerImpl::GetInstance());
|
||||
|
||||
openAppAEUPP = NewAEEventHandlerProc(DoOpenAppAE);
|
||||
openDocAEUPP = NewAEEventHandlerProc(DoOpenDocAE);
|
||||
printDocAEUPP = NewAEEventHandlerProc(DoPrintDocAE);
|
||||
quitAEUPP = NewAEEventHandlerProc(DoQuitAE);
|
||||
|
||||
theErr = AEInstallEventHandler(kCoreEventClass, // install oapp
|
||||
kAEOpenApplication, openAppAEUPP, 0, false);
|
||||
if (theErr != PLErrors::kNone)
|
||||
YellowAlert(kYellowAppleEventErr, theErr);
|
||||
|
||||
theErr = AEInstallEventHandler(kCoreEventClass, // install odoc
|
||||
kAEOpenDocuments, openDocAEUPP, 0, false);
|
||||
if (theErr != PLErrors::kNone)
|
||||
YellowAlert(kYellowAppleEventErr, theErr);
|
||||
|
||||
theErr = AEInstallEventHandler(kCoreEventClass, // install pdoc
|
||||
kAEPrintDocuments, printDocAEUPP, 0, false);
|
||||
if (theErr != PLErrors::kNone)
|
||||
YellowAlert(kYellowAppleEventErr, theErr);
|
||||
|
||||
theErr = AEInstallEventHandler(kCoreEventClass, // install quit
|
||||
kAEQuitApplication, quitAEUPP, 0, false);
|
||||
if (theErr != PLErrors::kNone)
|
||||
YellowAlert(kYellowAppleEventErr, theErr);
|
||||
|
||||
theErr = AESetInteractionAllowed(kAEInteractWithAll);
|
||||
if (theErr != PLErrors::kNone)
|
||||
YellowAlert(kYellowAppleEventErr, theErr);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,13 @@
|
||||
#include "FontManager.h"
|
||||
#include "MainWindow.h"
|
||||
#include "RectUtils.h"
|
||||
#include "RenderedFont.h"
|
||||
#include "RenderedFontMetrics.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "Room.h"
|
||||
#include "Utilities.h"
|
||||
#include "WindowDef.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
|
||||
#define kBannerPageTopPICT 1993
|
||||
@@ -57,17 +62,17 @@ void DrawBanner (Point *topLeft)
|
||||
topLeft->v = wholePage.top;
|
||||
partPage = wholePage;
|
||||
partPage.bottom = partPage.top + 190;
|
||||
LoadScaledGraphic(workSrcMap, kBannerPageTopPICT, &partPage);
|
||||
LoadScaledGraphicCustom(workSrcMap, kBannerPageTopPICT, &partPage);
|
||||
|
||||
partPage = wholePage;
|
||||
partPage.top = partPage.bottom - 30;
|
||||
mapBounds = partPage;
|
||||
ZeroRectCorner(&mapBounds);
|
||||
theErr = CreateOffScreenGWorld(&tempMap, &mapBounds, kPreferredPixelFormat);
|
||||
LoadGraphic(tempMap, kBannerPageBottomPICT);
|
||||
LoadGraphicCustom(tempMap, kBannerPageBottomPICT);
|
||||
|
||||
theErr = CreateOffScreenGWorld(&tempMask, &mapBounds, GpPixelFormats::kBW1);
|
||||
LoadGraphic(tempMask, kBannerPageBottomMask);
|
||||
LoadGraphicCustom(tempMask, kBannerPageBottomMask);
|
||||
|
||||
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
|
||||
(BitMap *)*GetGWorldPixMap(tempMask),
|
||||
@@ -117,13 +122,15 @@ void DrawBannerMessage (Point topLeft)
|
||||
|
||||
PasStringCopy((*thisHouse)->banner, bannerStr);
|
||||
|
||||
workSrcMap->SetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
workSrcMap->SetForeColor(StdColors::Black());
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
|
||||
count = 0;
|
||||
do
|
||||
{
|
||||
GetLineOfText(bannerStr, count, subStr);
|
||||
workSrcMap->DrawString(Point::Create(topLeft.h + 16, topLeft.v + 32 + (count * 20)), subStr, true);
|
||||
workSrcMap->DrawString(Point::Create(topLeft.h + 16, topLeft.v + 32 + (count * 20)), subStr, blackColor, appFont);
|
||||
count++;
|
||||
}
|
||||
while (subStr[0] > 0);
|
||||
@@ -144,13 +151,12 @@ void DrawBannerMessage (Point topLeft)
|
||||
GetLocalizedString(4, subStr);
|
||||
PasStringConcat(bannerStr, subStr);
|
||||
|
||||
workSrcMap->SetForeColor(StdColors::Red());
|
||||
workSrcMap->DrawString(Point::Create(topLeft.h + 16, topLeft.v + 164), bannerStr, true);
|
||||
PortabilityLayer::ResolveCachingColor redColor = StdColors::Red();
|
||||
workSrcMap->DrawString(Point::Create(topLeft.h + 16, topLeft.v + 164), bannerStr, redColor, appFont);
|
||||
|
||||
GetLocalizedString(5, subStr);
|
||||
workSrcMap->DrawString(Point::Create(topLeft.h + 16, topLeft.v + 180), subStr, true);
|
||||
workSrcMap->DrawString(Point::Create(topLeft.h + 16, topLeft.v + 180), subStr, redColor, appFont);
|
||||
}
|
||||
workSrcMap->SetForeColor(StdColors::Black());
|
||||
|
||||
SetGraphicsPort(wasGWorld);
|
||||
}
|
||||
@@ -196,35 +202,53 @@ void BringUpBanner (void)
|
||||
// in a house. It comes up when the player gets a star (the game is pausedÉ
|
||||
// and the user informed as to how many remain).
|
||||
|
||||
void DisplayStarsRemaining (void)
|
||||
void DisplayStarsRemaining(void)
|
||||
{
|
||||
Rect src, bounds;
|
||||
Str255 theStr;
|
||||
DrawSurface *surface = mainWindow->GetDrawSurface();
|
||||
|
||||
PortabilityLayer::WindowManager *wm = PortabilityLayer::WindowManager::GetInstance();
|
||||
|
||||
QSetRect(&bounds, 0, 0, 256, 64);
|
||||
CenterRectInRect(&bounds, &thisMac.fullScreen);
|
||||
QOffsetRect(&bounds, -thisMac.fullScreen.left, -thisMac.fullScreen.top);
|
||||
src = bounds;
|
||||
InsetRect(&src, 64, 32);
|
||||
QOffsetRect(&bounds, 0, -20);
|
||||
|
||||
surface->SetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
// Inset by 1 because the original graphic is bordered, and we want to use the window chrome for the border because it will apply the flicker effect
|
||||
Rect windowBounds = bounds.Inset(1, 1);
|
||||
|
||||
PortabilityLayer::WindowDef wdef = PortabilityLayer::WindowDef::Create(windowBounds, 0, true, 0, 0, PSTR(""));
|
||||
|
||||
// Zero out
|
||||
QOffsetRect(&bounds, -bounds.left - 1, -bounds.top - 1);
|
||||
|
||||
Window *starsWindow = wm->CreateWindow(wdef);
|
||||
wm->PutWindowBehind(starsWindow, wm->GetPutInFrontSentinel());
|
||||
|
||||
DrawSurface *surface = starsWindow->GetDrawSurface();
|
||||
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
NumToString((long)numStarsRemaining, theStr);
|
||||
|
||||
QOffsetRect(&bounds, 0, -20);
|
||||
|
||||
if (numStarsRemaining < 2)
|
||||
LoadScaledGraphic(surface, kStarRemainingPICT, &bounds);
|
||||
LoadScaledGraphicCustom(surface, kStarRemainingPICT, &bounds);
|
||||
else
|
||||
{
|
||||
LoadScaledGraphic(surface, kStarsRemainingPICT, &bounds);
|
||||
const Point textPoint = Point::Create(bounds.left + 102 - (surface->MeasureString(theStr) / 2), bounds.top + 23);
|
||||
ColorText(surface, textPoint, theStr, 4L);
|
||||
LoadScaledGraphicCustom(surface, kStarsRemainingPICT, &bounds);
|
||||
const Point textPoint = Point::Create(bounds.left + 102 - (appFont->MeasurePStr(theStr) / 2), bounds.top + 23);
|
||||
ColorText(surface, textPoint, theStr, 4L, appFont);
|
||||
}
|
||||
|
||||
|
||||
if (doZooms)
|
||||
wm->FlickerWindowIn(starsWindow, 32);
|
||||
|
||||
DelayTicks(60);
|
||||
if (WaitForInputEvent(30))
|
||||
RestoreEntireGameScreen();
|
||||
CopyRectWorkToMain(&bounds);
|
||||
WaitForInputEvent(30);
|
||||
|
||||
if (doZooms)
|
||||
wm->FlickerWindowOut(starsWindow, 32);
|
||||
|
||||
wm->DestroyWindow(starsWindow);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "PLPalettes.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "QDStandardPalette.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
|
||||
|
||||
//============================================================== Functions
|
||||
@@ -19,14 +20,11 @@
|
||||
// this function draws text in that color. It assumes the current port,É
|
||||
// the current font, the current pen location, etc.
|
||||
|
||||
void ColorText (DrawSurface *surface, const Point &point, StringPtr theStr, long color)
|
||||
void ColorText (DrawSurface *surface, const Point &point, StringPtr theStr, long color, PortabilityLayer::RenderedFont *font)
|
||||
{
|
||||
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[color];
|
||||
PortabilityLayer::ResolveCachingColor rColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(color);
|
||||
|
||||
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(rgbaColor);
|
||||
surface->DrawString(point, theStr, true);
|
||||
surface->SetForeColor(wasColor);
|
||||
surface->DrawString(point, theStr, rColor, font);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- ColorRect
|
||||
@@ -36,12 +34,9 @@ void ColorText (DrawSurface *surface, const Point &point, StringPtr theStr, long
|
||||
|
||||
void ColorRect (DrawSurface *surface, const Rect &theRect, long color)
|
||||
{
|
||||
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[color];
|
||||
PortabilityLayer::ResolveCachingColor rColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(color);
|
||||
|
||||
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(rgbaColor);
|
||||
surface->FillRect(theRect);
|
||||
surface->SetForeColor(wasColor);
|
||||
surface->FillRect(theRect, rColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- ColorOval
|
||||
@@ -51,22 +46,16 @@ void ColorRect (DrawSurface *surface, const Rect &theRect, long color)
|
||||
|
||||
void ColorOval (DrawSurface *surface, const Rect &theRect, long color)
|
||||
{
|
||||
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[color];
|
||||
PortabilityLayer::ResolveCachingColor rColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(color);
|
||||
|
||||
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(rgbaColor);
|
||||
surface->FillEllipse(theRect);
|
||||
surface->SetForeColor(wasColor);
|
||||
surface->FillEllipse(theRect, rColor);
|
||||
}
|
||||
|
||||
void ColorOvalMaskPattern(DrawSurface *surface, const Rect &theRect, long color, bool isMask, const uint8_t *pattern)
|
||||
void ColorOvalMaskPattern(DrawSurface *surface, const Rect &theRect, long color, const uint8_t *pattern)
|
||||
{
|
||||
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[color];
|
||||
PortabilityLayer::ResolveCachingColor rColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(color);
|
||||
|
||||
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(rgbaColor);
|
||||
surface->FillEllipseWithPattern(theRect, isMask, pattern);
|
||||
surface->SetForeColor(wasColor);
|
||||
surface->FillEllipseWithMaskPattern(theRect, pattern, rColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- ColorRegionMaskPattern
|
||||
@@ -74,14 +63,10 @@ void ColorOvalMaskPattern(DrawSurface *surface, const Rect &theRect, long color,
|
||||
// Given a region and color index, this function draws a solidÉ
|
||||
// region in that color. Current port, pen mode, etc. assumed.
|
||||
|
||||
void ColorRegionMaskPattern (DrawSurface *surface, PortabilityLayer::ScanlineMask *scanlineMask, long colorIndex, bool isMask, const uint8_t *pattern)
|
||||
void ColorRegionMaskPattern (DrawSurface *surface, PortabilityLayer::ScanlineMask *scanlineMask, long colorIndex, const uint8_t *pattern)
|
||||
{
|
||||
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[colorIndex];
|
||||
|
||||
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(rgbaColor);
|
||||
surface->FillScanlineMaskWithPattern(scanlineMask, isMask, pattern);
|
||||
surface->SetForeColor(wasColor);
|
||||
PortabilityLayer::ResolveCachingColor rColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(colorIndex);
|
||||
surface->FillScanlineMaskWithMaskPattern(scanlineMask, pattern, rColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- ColorLine
|
||||
@@ -91,12 +76,9 @@ void ColorRegionMaskPattern (DrawSurface *surface, PortabilityLayer::ScanlineMas
|
||||
|
||||
void ColorLine (DrawSurface *surface, short h0, short v0, short h1, short v1, long color)
|
||||
{
|
||||
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[color];
|
||||
PortabilityLayer::ResolveCachingColor cacheColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(color);
|
||||
|
||||
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(rgbaColor);
|
||||
surface->DrawLine(Point::Create(h0, v0), Point::Create(h1, v1));
|
||||
surface->SetForeColor(wasColor);
|
||||
surface->DrawLine(Point::Create(h0, v0), Point::Create(h1, v1), cacheColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- HiliteRect
|
||||
@@ -125,12 +107,9 @@ void HiliteRect (DrawSurface *surface, const Rect &theRect, short color1, short
|
||||
|
||||
void ColorFrameRect (DrawSurface *surface, const Rect &theRect, long color)
|
||||
{
|
||||
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[color];
|
||||
PortabilityLayer::ResolveCachingColor rColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(color);
|
||||
|
||||
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(rgbaColor);
|
||||
surface->FrameRect(theRect);
|
||||
surface->SetForeColor(wasColor);
|
||||
surface->FrameRect(theRect, rColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- ColorFrameWHRect
|
||||
@@ -157,12 +136,9 @@ void ColorFrameWHRect (DrawSurface *surface, short left, short top, short wide,
|
||||
|
||||
void ColorFrameOval (DrawSurface *surface, const Rect &theRect, long color)
|
||||
{
|
||||
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[color];
|
||||
PortabilityLayer::ResolveCachingColor rColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(color);
|
||||
|
||||
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(rgbaColor);
|
||||
surface->FrameEllipse(theRect);
|
||||
surface->SetForeColor(wasColor);
|
||||
surface->FrameEllipse(theRect, rColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- LtGrayForeColor
|
||||
@@ -170,9 +146,9 @@ void ColorFrameOval (DrawSurface *surface, const Rect &theRect, long color)
|
||||
// This function finds the closest match to a "light gray" in theÉ
|
||||
// current palette and sets the pen color to that.
|
||||
|
||||
void LtGrayForeColor (DrawSurface *surface)
|
||||
PortabilityLayer::ResolveCachingColor LtGrayForeColor ()
|
||||
{
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(191, 191, 191, 255));
|
||||
return PortabilityLayer::RGBAColor::Create(191, 191, 191, 255);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- GrayForeColor
|
||||
@@ -180,9 +156,9 @@ void LtGrayForeColor (DrawSurface *surface)
|
||||
// This function finds the closest match to a "medium gray" in theÉ
|
||||
// current palette and sets the pen color to that.
|
||||
|
||||
void GrayForeColor (DrawSurface *surface)
|
||||
PortabilityLayer::ResolveCachingColor GrayForeColor ()
|
||||
{
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(127, 127, 127, 255));
|
||||
return PortabilityLayer::RGBAColor::Create(127, 127, 127, 255);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DkGrayForeColor
|
||||
@@ -190,7 +166,7 @@ void GrayForeColor (DrawSurface *surface)
|
||||
// This function finds the closest match to a "dark gray" in theÉ
|
||||
// current palette and sets the pen color to that.
|
||||
|
||||
void DkGrayForeColor (DrawSurface *surface)
|
||||
PortabilityLayer::ResolveCachingColor DkGrayForeColor ()
|
||||
{
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(63, 63, 63, 255));
|
||||
return PortabilityLayer::RGBAColor::Create(63, 63, 63, 255);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "Marquee.h"
|
||||
#include "ObjectEdit.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "WindowDef.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
@@ -66,17 +67,19 @@ void UpdateCoordWindow (void)
|
||||
{
|
||||
#ifndef COMPILEDEMO
|
||||
Str255 tempStr, numStr;
|
||||
GrafPtr wasPort;
|
||||
|
||||
if (coordWindow == nil)
|
||||
return;
|
||||
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
PortabilityLayer::ResolveCachingColor blueColor = StdColors::Blue();
|
||||
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(9, 0, true);
|
||||
|
||||
DrawSurface *surface = coordWindow->GetDrawSurface();
|
||||
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(coordWindowRect);
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->FillRect(coordWindowRect, whiteColor);
|
||||
|
||||
PasStringCopy(PSTR("h: "), tempStr);
|
||||
if (coordH != -1)
|
||||
@@ -87,7 +90,7 @@ void UpdateCoordWindow (void)
|
||||
else
|
||||
PasStringConcat(tempStr, PSTR("-"));
|
||||
|
||||
surface->DrawString(Point::Create(5, 12), tempStr, true);
|
||||
surface->DrawString(Point::Create(5, 12), tempStr, blackColor, appFont);
|
||||
|
||||
PasStringCopy(PSTR("v: "), tempStr);
|
||||
if (coordV != -1)
|
||||
@@ -98,9 +101,8 @@ void UpdateCoordWindow (void)
|
||||
else
|
||||
PasStringConcat(tempStr, PSTR("-"));
|
||||
|
||||
surface->DrawString(Point::Create(4, 22), tempStr, true);
|
||||
surface->DrawString(Point::Create(4, 22), tempStr, blackColor, appFont);
|
||||
|
||||
surface->SetForeColor(StdColors::Blue());
|
||||
PasStringCopy(PSTR("d: "), tempStr);
|
||||
if (coordD != -1)
|
||||
{
|
||||
@@ -110,8 +112,7 @@ void UpdateCoordWindow (void)
|
||||
else
|
||||
PasStringConcat(tempStr, PSTR("-"));
|
||||
|
||||
surface->DrawString(Point::Create(5, 32), tempStr, true);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->DrawString(Point::Create(5, 32), tempStr, blueColor, appFont);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -157,8 +158,6 @@ void OpenCoordWindow (void)
|
||||
coordV = -1;
|
||||
coordD = -1;
|
||||
|
||||
coordWindow->GetDrawSurface()->SetApplicationFont(9, 0);
|
||||
|
||||
if (objActive != kNoObjectSelected)
|
||||
{
|
||||
if (ObjectHasHandle(&direction, &dist))
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "DialogManager.h"
|
||||
#include "PLArrayView.h"
|
||||
#include "PLButtonWidget.h"
|
||||
#include "PLControlDefinitions.h"
|
||||
#include "PLNumberFormatting.h"
|
||||
#include "PLPasStr.h"
|
||||
@@ -16,6 +17,9 @@
|
||||
#include "Externs.h"
|
||||
#include "FontFamily.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "RenderedFont.h"
|
||||
#include "RenderedFontMetrics.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -35,7 +39,7 @@ void BringUpDialog (Dialog **theDialog, short dialogID, const DialogTextSubstitu
|
||||
// CenterDialog(dialogID);
|
||||
if (*theDialog == nil)
|
||||
RedAlert(kErrDialogDidntLoad);
|
||||
SetGraphicsPort(&(*theDialog)->GetWindow()->m_surface);
|
||||
SetGraphicsPort((*theDialog)->GetWindow()->GetDrawSurface());
|
||||
ShowWindow((*theDialog)->GetWindow());
|
||||
DrawDefaultButton(*theDialog);
|
||||
}
|
||||
@@ -347,9 +351,9 @@ void FlashDialogButton (Dialog *theDialog, short itemNumber)
|
||||
|
||||
PortabilityLayer::Widget *widget = theDialog->GetItems()[itemNumber - 1].GetWidget();
|
||||
|
||||
widget->SetHighlightStyle(kControlButtonPart);
|
||||
widget->SetHighlightStyle(kControlButtonPart, true);
|
||||
Delay(8, &dummyLong);
|
||||
widget->SetHighlightStyle(0);
|
||||
widget->SetHighlightStyle(kControlButtonPart, false);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawDefaultButton
|
||||
@@ -362,18 +366,7 @@ void DrawDefaultButton (Dialog *theDialog)
|
||||
Rect itemRect = firstItem.GetWidget()->GetRect();
|
||||
DrawSurface *surface = theDialog->GetWindow()->GetDrawSurface();
|
||||
|
||||
InsetRect(&itemRect, -4, -4);
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
|
||||
for (int xOffset = -1; xOffset <= 1; xOffset++)
|
||||
{
|
||||
for (int yOffset = -1; yOffset <= 1; yOffset++)
|
||||
{
|
||||
const Rect offsetRect = itemRect + Point::Create(xOffset, yOffset);
|
||||
surface->FrameRoundRect(offsetRect, 8, 8);
|
||||
}
|
||||
}
|
||||
PortabilityLayer::ButtonWidget::DrawDefaultButtonChrome(itemRect, surface);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- GetDialogString
|
||||
@@ -582,45 +575,45 @@ void DrawDialogUserText (Dialog *dial, short item, StringPtr text, Boolean inver
|
||||
|
||||
DrawSurface *surface = dial->GetWindow()->GetDrawSurface();
|
||||
|
||||
surface->SetApplicationFont(9, PortabilityLayer::FontFamilyFlag_None);
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(9, PortabilityLayer::FontFamilyFlag_None, true);
|
||||
|
||||
PasStringCopy(text, stringCopy);
|
||||
|
||||
Rect iRect = dial->GetItems()[item - 1].GetWidget()->GetRect();
|
||||
|
||||
if ((surface->MeasureString(stringCopy) + 2) > (iRect.right - iRect.left))
|
||||
CollapseStringToWidth(surface, stringCopy, iRect.right - iRect.left - 2);
|
||||
if ((appFont->MeasurePStr(stringCopy) + 2) > (iRect.right - iRect.left))
|
||||
CollapseStringToWidth(appFont, stringCopy, iRect.right - iRect.left - 2);
|
||||
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(iRect);
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
surface->FillRect(iRect, whiteColor);
|
||||
|
||||
short strWidth = surface->MeasureString(stringCopy);
|
||||
short strWidth = appFont->MeasurePStr(stringCopy);
|
||||
inset = ((iRect.right - iRect.left) - (strWidth + 2)) / 2;
|
||||
iRect.left += inset;
|
||||
iRect.right -= inset;
|
||||
|
||||
// Draw centered
|
||||
|
||||
const int32_t ascender = surface->MeasureFontAscender();
|
||||
const int32_t ascender = appFont->GetMetrics().m_ascent;
|
||||
|
||||
PortabilityLayer::ResolveCachingColor backgroundColor;
|
||||
PortabilityLayer::ResolveCachingColor textColor;
|
||||
|
||||
if (invert)
|
||||
{
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->FillRect(iRect);
|
||||
surface->SetForeColor(StdColors::White());
|
||||
backgroundColor = StdColors::Black();
|
||||
textColor = StdColors::White();
|
||||
}
|
||||
else
|
||||
{
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(iRect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
backgroundColor = StdColors::White();
|
||||
textColor = StdColors::Black();
|
||||
}
|
||||
|
||||
const Point centeredDrawPoint = Point::Create((iRect.left + iRect.right - strWidth) / 2, (iRect.top + iRect.bottom + ascender) / 2);
|
||||
surface->DrawString(centeredDrawPoint, stringCopy, true);
|
||||
surface->FillRect(iRect, backgroundColor);
|
||||
|
||||
if (invert)
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
const Point centeredDrawPoint = Point::Create((iRect.left + iRect.right - strWidth) / 2, (iRect.top + iRect.bottom + ascender) / 2);
|
||||
surface->DrawString(centeredDrawPoint, stringCopy, textColor, appFont);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawDialogUserText
|
||||
@@ -635,16 +628,16 @@ void DrawDialogUserText2 (Dialog *dial, short item, StringPtr text)
|
||||
short iType;
|
||||
|
||||
DrawSurface *surface = dial->GetWindow()->GetDrawSurface();
|
||||
surface->SetApplicationFont(9, PortabilityLayer::FontFamilyFlag_None);
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(9, PortabilityLayer::FontFamilyFlag_None, true);
|
||||
|
||||
PasStringCopy(text, stringCopy);
|
||||
const Rect iRect = dial->GetItems()[item - 1].GetWidget()->GetRect();
|
||||
|
||||
if ((surface->MeasureString(stringCopy) + 2) > (iRect.right - iRect.left))
|
||||
CollapseStringToWidth(surface, stringCopy, iRect.right - iRect.left - 2);
|
||||
if ((appFont->MeasurePStr(stringCopy) + 2) > (iRect.right - iRect.left))
|
||||
CollapseStringToWidth(appFont, stringCopy, iRect.right - iRect.left - 2);
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->DrawString(Point::Create(iRect.left, iRect.bottom), stringCopy, true);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
surface->DrawString(Point::Create(iRect.left, iRect.bottom), stringCopy, blackColor, appFont);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- LoadDialogPICT
|
||||
@@ -665,14 +658,14 @@ void LoadDialogPICT (Dialog *theDialog, short item, short theID)
|
||||
//-------------------------------------------------------------- FrameDialogItem
|
||||
// Given a dialog item, this function draws a box around it.
|
||||
|
||||
void FrameDialogItem (Dialog *theDialog, short item)
|
||||
void FrameDialogItem (Dialog *theDialog, short item, PortabilityLayer::ResolveCachingColor &color)
|
||||
{
|
||||
const PortabilityLayer::DialogItem &itemRef = theDialog->GetItems()[item - 1];
|
||||
PortabilityLayer::Widget *widget = itemRef.GetWidget();
|
||||
|
||||
const Rect itemRect = widget->GetRect();
|
||||
|
||||
theDialog->GetWindow()->GetDrawSurface()->FrameRect(itemRect);
|
||||
theDialog->GetWindow()->GetDrawSurface()->FrameRect(itemRect, color);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- FrameDialogItemC
|
||||
@@ -683,23 +676,22 @@ void FrameDialogItemC (Dialog *theDialog, short item, long color)
|
||||
DrawSurface *surface = theDialog->GetWindow()->GetDrawSurface();
|
||||
const Rect itemRect = theDialog->GetItems()[item - 1].GetWidget()->GetRect();
|
||||
|
||||
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(PortabilityLayer::StandardPalette::GetInstance()->GetColors()[color]);
|
||||
surface->FrameRect(itemRect);
|
||||
surface->SetForeColor(wasColor);
|
||||
PortabilityLayer::ResolveCachingColor frameColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(color);
|
||||
|
||||
surface->FrameRect(itemRect, frameColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- FrameOvalDialogItem
|
||||
// Given a dialog item, this function draws an oval around it.
|
||||
|
||||
void FrameOvalDialogItem (Dialog *theDialog, short item)
|
||||
void FrameOvalDialogItem (Dialog *theDialog, short item, PortabilityLayer::ResolveCachingColor &color)
|
||||
{
|
||||
const PortabilityLayer::DialogItem &itemRef = theDialog->GetItems()[item - 1];
|
||||
PortabilityLayer::Widget *widget = itemRef.GetWidget();
|
||||
|
||||
const Rect itemRect = widget->GetRect();
|
||||
|
||||
theDialog->GetWindow()->GetDrawSurface()->FrameEllipse(itemRect);
|
||||
theDialog->GetWindow()->GetDrawSurface()->FrameEllipse(itemRect, color);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- BorderDialogItem
|
||||
@@ -713,6 +705,9 @@ void BorderDialogItem(Dialog *theDialog, short item, short sides, short thicknes
|
||||
// 4 = bottom
|
||||
// 8 = right ... so 6 = top & bottom, 15 = all 4 sides
|
||||
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
|
||||
const PortabilityLayer::DialogItem &itemRef = theDialog->GetItems()[item - 1];
|
||||
PortabilityLayer::Widget *widget = itemRef.GetWidget();
|
||||
const Rect itemRect = widget->GetRect();
|
||||
@@ -726,13 +721,11 @@ void BorderDialogItem(Dialog *theDialog, short item, short sides, short thicknes
|
||||
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);
|
||||
surface->FillRect(rect, whiteColor);
|
||||
surface->FillRectWithMaskPattern8x8(rect, pattern,blackColor);
|
||||
}
|
||||
else
|
||||
surface->FillRect(rect);
|
||||
surface->FillRect(rect, blackColor);
|
||||
sides -= 8;
|
||||
}
|
||||
if (sides >= 4) // 4 = bottom
|
||||
@@ -742,13 +735,11 @@ void BorderDialogItem(Dialog *theDialog, short item, short sides, short thicknes
|
||||
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);
|
||||
surface->FillRect(rect, whiteColor);
|
||||
surface->FillRectWithMaskPattern8x8(rect, pattern, blackColor);
|
||||
}
|
||||
else
|
||||
surface->FillRect(rect);
|
||||
surface->FillRect(rect, blackColor);
|
||||
sides -= 4;
|
||||
}
|
||||
if (sides >= 2) // 2 = top
|
||||
@@ -758,13 +749,11 @@ void BorderDialogItem(Dialog *theDialog, short item, short sides, short thicknes
|
||||
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);
|
||||
surface->FillRect(rect, whiteColor);
|
||||
surface->FillRectWithMaskPattern8x8(rect, pattern, blackColor);
|
||||
}
|
||||
else
|
||||
surface->FillRect(rect);
|
||||
surface->FillRect(rect, blackColor);
|
||||
sides -= 2;
|
||||
}
|
||||
if (sides >= 1) // 1 = left
|
||||
@@ -774,13 +763,11 @@ void BorderDialogItem(Dialog *theDialog, short item, short sides, short thicknes
|
||||
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);
|
||||
surface->FillRect(rect, whiteColor);
|
||||
surface->FillRectWithMaskPattern8x8(rect, pattern, blackColor);
|
||||
}
|
||||
else
|
||||
surface->FillRect(rect);
|
||||
surface->FillRect(rect, blackColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -794,13 +781,14 @@ void ShadowDialogItem (Dialog *theDialog, short item, short thickness)
|
||||
const PortabilityLayer::DialogItem &itemRef = theDialog->GetItems()[item - 1];
|
||||
const Rect itemRect = itemRef.GetWidget()->GetRect();
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
|
||||
const Point bottomLeftCorner = Point::Create(itemRect.left + thickness, itemRect.bottom);
|
||||
const Point topRightCorner = Point::Create(itemRect.right, itemRect.top + thickness);
|
||||
const Point bottomRightCorner = Point::Create(itemRect.right + thickness, itemRect.bottom + thickness);
|
||||
|
||||
surface->FillRect(Rect::Create(topRightCorner.v, topRightCorner.h, bottomRightCorner.v, bottomRightCorner.h));
|
||||
surface->FillRect(Rect::Create(bottomLeftCorner.v, bottomLeftCorner.h, bottomRightCorner.v, bottomRightCorner.h));
|
||||
surface->FillRect(Rect::Create(topRightCorner.v, topRightCorner.h, bottomRightCorner.v, bottomRightCorner.h), blackColor);
|
||||
surface->FillRect(Rect::Create(bottomLeftCorner.v, bottomLeftCorner.h, bottomRightCorner.v, bottomRightCorner.h), blackColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- EraseDialogItem
|
||||
@@ -813,9 +801,9 @@ void EraseDialogItem (Dialog *theDialog, short item)
|
||||
|
||||
const Rect itemRect = widget->GetRect();
|
||||
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
|
||||
DrawSurface *surface = theDialog->GetWindow()->GetDrawSurface();
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(itemRect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->FillRect(itemRect, whiteColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
|
||||
#include "PLDialogs.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class ResolveCachingColor;
|
||||
}
|
||||
|
||||
struct DialogTextSubstitutions;
|
||||
|
||||
void BringUpDialog (Dialog **theDialog, short dialogID, const DialogTextSubstitutions *);
|
||||
@@ -40,9 +45,9 @@ void MyDisableControl(Dialog *, short);
|
||||
void DrawDialogUserText (Dialog *, short, StringPtr, Boolean);
|
||||
void DrawDialogUserText2 (Dialog *, short, StringPtr);
|
||||
void LoadDialogPICT (Dialog *, short, short);
|
||||
void FrameDialogItem (Dialog *, short);
|
||||
void FrameDialogItem (Dialog *, short, PortabilityLayer::ResolveCachingColor &color);
|
||||
void FrameDialogItemC (Dialog *, short, long);
|
||||
void FrameOvalDialogItem (Dialog *, short);
|
||||
void FrameOvalDialogItem (Dialog *, short, PortabilityLayer::ResolveCachingColor &color);
|
||||
void BorderDialogItem (Dialog *theDialog, short item, short sides, short thickness, const uint8_t *pattern);
|
||||
void ShadowDialogItem (Dialog *, short, short);
|
||||
void EraseDialogItem (Dialog *, short);
|
||||
|
||||
@@ -59,6 +59,7 @@ void NilSavedMaps (void)
|
||||
}
|
||||
savedMaps[i].where = -1;
|
||||
savedMaps[i].who = -1;
|
||||
savedMaps[i].component = -1;
|
||||
}
|
||||
numSavedMaps = 0;
|
||||
}
|
||||
@@ -69,7 +70,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, SInt16 where, SInt16 who)
|
||||
short BackUpToSavedMap (Rect *theRect, SInt16 where, SInt16 who, SInt16 component)
|
||||
{
|
||||
Rect mapRect;
|
||||
PLError_t theErr;
|
||||
@@ -89,6 +90,7 @@ short BackUpToSavedMap (Rect *theRect, SInt16 where, SInt16 who)
|
||||
|
||||
savedMaps[numSavedMaps].where = where;
|
||||
savedMaps[numSavedMaps].who = who;
|
||||
savedMaps[numSavedMaps].component = component;
|
||||
numSavedMaps++;
|
||||
|
||||
return (numSavedMaps - 1); // return array index
|
||||
@@ -99,7 +101,7 @@ short BackUpToSavedMap (Rect *theRect, SInt16 where, SInt16 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.
|
||||
|
||||
SInt16 ReBackUpSavedMap (Rect *theRect, SInt16 where, SInt16 who)
|
||||
SInt16 ReBackUpSavedMap (Rect *theRect, SInt16 where, SInt16 who, SInt16 component)
|
||||
{
|
||||
Rect mapRect;
|
||||
short i, foundIndex;
|
||||
@@ -108,7 +110,7 @@ SInt16 ReBackUpSavedMap (Rect *theRect, SInt16 where, SInt16 who)
|
||||
|
||||
for (i = 0; i < numSavedMaps; i++)
|
||||
{
|
||||
if ((savedMaps[i].where == where) && (savedMaps[i].who == who))
|
||||
if ((savedMaps[i].where == where) && (savedMaps[i].who == who) && (savedMaps[i].component == component))
|
||||
{
|
||||
foundIndex = i;
|
||||
mapRect = *theRect;
|
||||
@@ -124,7 +126,7 @@ SInt16 ReBackUpSavedMap (Rect *theRect, SInt16 where, SInt16 who)
|
||||
}
|
||||
}
|
||||
|
||||
return BackUpToSavedMap(theRect, where, who);
|
||||
return BackUpToSavedMap(theRect, where, who, component);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- RemoveFromSavedMap
|
||||
@@ -179,14 +181,14 @@ SInt16 RemoveFromSavedMap (SInt16 index)
|
||||
// This copies the saved background swatch to the screen - effectivelyÉ
|
||||
// covering up or "erasing" the object.
|
||||
|
||||
void RestoreFromSavedMap (short where, short who, Boolean doSparkle)
|
||||
void RestoreFromSavedMap (SInt16 where, SInt16 who, SInt16 component, Boolean doSparkle)
|
||||
{
|
||||
Rect mapRect, bounds;
|
||||
short i;
|
||||
|
||||
for (i = 0; i < numSavedMaps; i++)
|
||||
{
|
||||
if ((savedMaps[i].where == where) && (savedMaps[i].who == who) &&
|
||||
if ((savedMaps[i].where == where) && (savedMaps[i].who == who) && (savedMaps[i].component == component) &&
|
||||
(savedMaps[i].map != nil))
|
||||
{
|
||||
mapRect = savedMaps[i].dest;
|
||||
@@ -384,7 +386,7 @@ void AddCandleFlame (SInt16 where, SInt16 who, SInt16 h, SInt16 v)
|
||||
QOffsetRect(&src, 2, 0);
|
||||
}
|
||||
QSetRect(&bounds, 0, 0, 16, 15 * kNumCandleFlames);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who, kCandleFlameComponent);
|
||||
if (savedNum != -1)
|
||||
{
|
||||
BackUpFlames(&src, savedNum);
|
||||
@@ -471,7 +473,7 @@ void AddTikiFlame (short where, short who, short h, short v)
|
||||
}
|
||||
QOffsetRect(&src, h, v);
|
||||
QSetRect(&bounds, 0, 0, 8, 10 * kNumTikiFlames);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who, kTikiFlamesComponent);
|
||||
if (savedNum != -1)
|
||||
{
|
||||
BackUpTikiFlames(&src, savedNum);
|
||||
@@ -560,7 +562,7 @@ void AddBBQCoals (short where, short who, short h, short v)
|
||||
}
|
||||
QOffsetRect(&src, h, v);
|
||||
QSetRect(&bounds, 0, 0, 32, 9 * kNumBBQCoals);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who, kBBQCoalsComponent);
|
||||
if (savedNum != -1)
|
||||
{
|
||||
BackUpBBQCoals(&src, savedNum);
|
||||
@@ -644,7 +646,7 @@ void AddPendulum (SInt16 where, SInt16 who, SInt16 h, SInt16 v)
|
||||
|
||||
clockFrame = 10;
|
||||
QSetRect(&bounds, 0, 0, 32, 28 * kNumPendulums);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who, kPendulumComponent);
|
||||
if (savedNum != -1)
|
||||
{
|
||||
QSetRect(&src, 0, 0, 32, 28);
|
||||
@@ -745,7 +747,7 @@ void AddStar (short where, short who, short h, short v)
|
||||
QOffsetRect(&src, h, v);
|
||||
|
||||
QSetRect(&bounds, 0, 0, 32, 31 * 6);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who, kStarComponent);
|
||||
if (savedNum != -1)
|
||||
{
|
||||
BackUpStar(&src, savedNum);
|
||||
|
||||
@@ -11,8 +11,10 @@
|
||||
#include "MainWindow.h"
|
||||
#include "Objects.h"
|
||||
#include "PLHacks.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "RectUtils.h"
|
||||
#include "Room.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
|
||||
|
||||
#define kShoveVelocity 8
|
||||
@@ -578,7 +580,8 @@ void HandleOutlet (short who)
|
||||
}
|
||||
else
|
||||
{
|
||||
workSrcMap->FillRect(dinahs[who].dest);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
workSrcMap->FillRect(dinahs[who].dest, blackColor);
|
||||
}
|
||||
AddRectToWorkRects(&dinahs[who].dest);
|
||||
}
|
||||
|
||||
@@ -348,11 +348,19 @@ public:
|
||||
|
||||
void AdjustRequestedResolution(uint32_t &physicalWidth, uint32_t &physicalHeight, uint32_t &virtualWidth, uint32_t &virtualHeight, float &pixelScaleX, float &pixelScaleY) override
|
||||
{
|
||||
if (physicalWidth < 640)
|
||||
physicalWidth = 640;
|
||||
|
||||
if (physicalHeight < 480)
|
||||
physicalHeight = 480;
|
||||
|
||||
double xMul = static_cast<double>(physicalWidth) / 640;
|
||||
double yMul = static_cast<double>(physicalHeight) / 480;
|
||||
|
||||
xMul = floor(xMul);
|
||||
yMul = floor(yMul);
|
||||
double granularity = 2.0;
|
||||
|
||||
xMul = floor(xMul * granularity) / granularity;
|
||||
yMul = floor(yMul * granularity) / granularity;
|
||||
|
||||
double minMul = std::max<double>(1.0, std::min(xMul, yMul));
|
||||
|
||||
|
||||
124
GpApp/Events.cpp
124
GpApp/Events.cpp
@@ -6,10 +6,8 @@
|
||||
//============================================================================
|
||||
|
||||
|
||||
#include "PLAppleEvents.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
#include "PLToolUtils.h"
|
||||
#include "PLQDraw.h"
|
||||
#include "DialogManager.h"
|
||||
#include "Externs.h"
|
||||
@@ -68,7 +66,7 @@ short BitchAboutColorDepth (void)
|
||||
void HandleMouseEvent (const GpMouseInputEvent &theEvent, uint32_t tick)
|
||||
{
|
||||
WindowPtr whichWindow;
|
||||
long menuChoice, newSize;
|
||||
long menuChoice;
|
||||
short thePart, hDelta, vDelta;
|
||||
Boolean isDoubleClick;
|
||||
Point evtPoint = Point::Create(theEvent.m_x, theEvent.m_y);
|
||||
@@ -110,11 +108,11 @@ void HandleMouseEvent (const GpMouseInputEvent &theEvent, uint32_t tick)
|
||||
}
|
||||
break;
|
||||
|
||||
case RegionIDs::kExpand:
|
||||
case RegionIDs::kResize:
|
||||
if (whichWindow == mapWindow)
|
||||
{
|
||||
newSize = GrowWindow(mapWindow, evtPoint, &thisMac.gray);
|
||||
ResizeMapWindow(LoWord(newSize), HiWord(newSize));
|
||||
PortabilityLayer::Vec2i newSize = TrackResize(mapWindow, evtPoint, 47, 35, &thisMac.gray);
|
||||
ResizeMapWindow(newSize.m_x, newSize.m_y);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -315,115 +313,6 @@ void HandleKeyEvent (const KeyDownStates &keyStates, const GpKeyboardInputEvent
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- HandleUpdateEvent
|
||||
// Handle an update event.
|
||||
|
||||
#if 0
|
||||
void HandleUpdateEvent (EventRecord *theEvent)
|
||||
{
|
||||
if ((WindowPtr)theEvent->message == mainWindow)
|
||||
{
|
||||
SetPort((GrafPtr)mainWindow);
|
||||
UpdateMainWindow();
|
||||
EndUpdate(mainWindow);
|
||||
}
|
||||
else if ((WindowPtr)theEvent->message == mapWindow)
|
||||
{
|
||||
SetPort((GrafPtr)mapWindow);
|
||||
UpdateMapWindow();
|
||||
EndUpdate(mapWindow);
|
||||
}
|
||||
else if ((WindowPtr)theEvent->message == toolsWindow)
|
||||
{
|
||||
SetPort((GrafPtr)toolsWindow);
|
||||
UpdateToolsWindow();
|
||||
EndUpdate(toolsWindow);
|
||||
}
|
||||
else if ((WindowPtr)theEvent->message == linkWindow)
|
||||
{
|
||||
SetPort((GrafPtr)linkWindow);
|
||||
UpdateLinkWindow();
|
||||
EndUpdate(linkWindow);
|
||||
}
|
||||
else if ((WindowPtr)theEvent->message == coordWindow)
|
||||
{
|
||||
SetPort((GrafPtr)coordWindow);
|
||||
UpdateCoordWindow();
|
||||
EndUpdate(coordWindow);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- HandleOSEvent
|
||||
// Handle an OS Event (MultiFinder - user has switched in or out of app).
|
||||
|
||||
void HandleOSEvent (EventRecord *theEvent)
|
||||
{
|
||||
PLError_t theErr;
|
||||
short buttonHit;
|
||||
|
||||
if (theEvent->message & 0x01000000) // suspend or resume event
|
||||
{
|
||||
if (theEvent->message & 0x00000001) // resume event
|
||||
{
|
||||
if (WhatsOurDepth() != thisMac.isDepth)
|
||||
{
|
||||
buttonHit = BitchAboutColorDepth();
|
||||
if (buttonHit == 1) // player wants to Quit
|
||||
{
|
||||
#ifndef COMPILEDEMO
|
||||
if (QuerySaveChanges())
|
||||
quitting = true;
|
||||
#else
|
||||
quitting = true;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
SwitchToDepth(thisMac.isDepth, thisMac.wasColorOrGray);
|
||||
}
|
||||
}
|
||||
switchedOut = false;
|
||||
InitCursor();
|
||||
if ((isPlayMusicIdle) && (theMode != kEditMode))
|
||||
{
|
||||
theErr = StartMusic();
|
||||
if (theErr != PLErrors::kNone)
|
||||
{
|
||||
YellowAlert(kYellowNoMusic, theErr);
|
||||
failedMusic = true;
|
||||
}
|
||||
}
|
||||
incrementModeTime = TickCount() + kIdleSplashTicks;
|
||||
|
||||
#ifndef COMPILEDEMO
|
||||
// if (theMode == kEditMode)
|
||||
// SeeIfValidScrapAvailable(true);
|
||||
#endif
|
||||
}
|
||||
else // suspend event
|
||||
{
|
||||
switchedOut = true;
|
||||
InitCursor();
|
||||
if ((isMusicOn) && (theMode != kEditMode))
|
||||
StopTheMusic();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- HandleHighLevelEvent
|
||||
// Handle an AppleEvent (Open Document, Quit Application, etc.).
|
||||
|
||||
void HandleHighLevelEvent (EventRecord *theEvent)
|
||||
{
|
||||
PLError_t theErr;
|
||||
|
||||
theErr = AEProcessAppleEvent(theEvent);
|
||||
if ((theErr != PLErrors::kNone) && (theErr != errAEEventNotHandled))
|
||||
YellowAlert(kYellowAppleEventErr, theErr);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//-------------------------------------------------------------- HandleSplashResolutionChange
|
||||
void HandleSplashResolutionChange(void)
|
||||
{
|
||||
@@ -454,8 +343,7 @@ void KeepWindowInBounds(Window *window)
|
||||
int32_t leftNudge = std::max<int32_t>(-windowRect.Left(), 0);
|
||||
int32_t rightNudge = std::min<int32_t>(thisMac.fullScreen.right - windowRect.Right(), 0);
|
||||
|
||||
window->m_wmX += leftNudge + rightNudge;
|
||||
window->m_wmY += topNudge + bottomNudge;
|
||||
window->SetPosition(window->GetPosition() + PortabilityLayer::Vec2i(leftNudge + rightNudge, topNudge + bottomNudge));
|
||||
}
|
||||
|
||||
void HandleEditorResolutionChange(void)
|
||||
@@ -497,7 +385,7 @@ void HandleIdleTask (void)
|
||||
HandleEditorResolutionChange();
|
||||
}
|
||||
|
||||
SetPort(&mainWindow->GetDrawSurface()->m_port);
|
||||
SetPort(mainWindow->GetDrawSurface());
|
||||
DoMarquee();
|
||||
|
||||
if ((autoRoomEdit) && (newRoomNow))
|
||||
|
||||
@@ -13,9 +13,12 @@
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class ResolveCachingColor;
|
||||
class ResourceArchive;
|
||||
class ScanlineMask;
|
||||
class ResTypeID;
|
||||
struct RGBAColor;
|
||||
class RenderedFont;
|
||||
}
|
||||
|
||||
#define kPreferredDepth 8
|
||||
@@ -48,6 +51,7 @@ namespace PortabilityLayer
|
||||
#define kErrNeed16Or256Colors 13
|
||||
|
||||
#define iAbout 1
|
||||
#define iAboutAerofoil 3
|
||||
#define iNewGame 1
|
||||
#define iTwoPlayer 2
|
||||
#define iOpenSavedGame 3
|
||||
@@ -124,6 +128,7 @@ typedef struct
|
||||
//-------------------------------------------------------------- Prototypes
|
||||
|
||||
void DoAbout (void); // --- About.c
|
||||
void DoAboutFramework (void);
|
||||
|
||||
void LoadCursors (void); // --- AnimCursor.c
|
||||
void DisposCursors (void);
|
||||
@@ -132,20 +137,19 @@ void DecrementCursor (void);
|
||||
void SpinCursor (short);
|
||||
void BackSpinCursor (short);
|
||||
|
||||
void ColorText (DrawSurface *surface, const Point &, StringPtr, long); // --- ColorUtils.c
|
||||
void ColorText (DrawSurface *surface, const Point &, StringPtr, long, PortabilityLayer::RenderedFont *font); // --- ColorUtils.c
|
||||
void ColorRect (DrawSurface *surface, const Rect &, long);
|
||||
void ColorOval (DrawSurface *surface, const Rect &, long);
|
||||
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 ColorOvalMaskPattern (DrawSurface *surface, const Rect &, long, const uint8_t *);
|
||||
void ColorRegionMaskPattern (DrawSurface *surface, PortabilityLayer::ScanlineMask *scanlineMask, long colorIndex, 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);
|
||||
void ColorFrameWHRect (DrawSurface *surface, short, short, short, short, long);
|
||||
void ColorFrameOval (DrawSurface *surface, const Rect &, long);
|
||||
void LtGrayForeColor (DrawSurface *surface);
|
||||
void GrayForeColor (DrawSurface *surface);
|
||||
void DkGrayForeColor (DrawSurface *surface);
|
||||
void RestoreColorsSlam (DrawSurface *surface);
|
||||
PortabilityLayer::ResolveCachingColor LtGrayForeColor ();
|
||||
PortabilityLayer::ResolveCachingColor GrayForeColor ();
|
||||
PortabilityLayer::ResolveCachingColor DkGrayForeColor ();
|
||||
|
||||
void MonitorWait (void); // --- DebugUtils.c
|
||||
void DisplayRect (Rect *);
|
||||
@@ -188,7 +192,7 @@ void PasStringConcat (StringPtr, const PLPasStr &);
|
||||
void GetLineOfText (StringPtr, short, StringPtr);
|
||||
void WrapText (StringPtr, short);
|
||||
void GetFirstWordOfString (StringPtr, StringPtr);
|
||||
void CollapseStringToWidth (DrawSurface *, StringPtr, short);
|
||||
void CollapseStringToWidth (PortabilityLayer::RenderedFont *, StringPtr, short);
|
||||
void GetChooserName (StringPtr);
|
||||
StringPtr GetLocalizedString (short, StringPtr);
|
||||
|
||||
@@ -222,7 +226,7 @@ void GetLocalWindowRect (WindowPtr, Rect *);
|
||||
//void FlagWindowFloating (WindowPtr);
|
||||
//Boolean IsWindowFloating (WindowPtr);
|
||||
void OpenMessageWindow (const PLPasStr&);
|
||||
void SetMessageWindowMessage (StringPtr);
|
||||
void SetMessageWindowMessage (StringPtr msg, const PortabilityLayer::RGBAColor &color);
|
||||
void CloseMessageWindow (void);
|
||||
void CloseThisWindow (WindowPtr *);
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include "PLDialogs.h"
|
||||
#include "PLNumberFormatting.h"
|
||||
#include "PLTextUtils.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "DialogManager.h"
|
||||
#include "Externs.h"
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
//============================================================================
|
||||
|
||||
|
||||
#include "PLToolUtils.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "PLEventQueue.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
@@ -17,7 +16,10 @@
|
||||
#include "InputManager.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Objects.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "RectUtils.h"
|
||||
#include "RenderedFont.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "Utilities.h"
|
||||
|
||||
|
||||
@@ -68,7 +70,7 @@ void DoGameOver (void)
|
||||
DrawSurface *surface = mainWindow->GetDrawSurface();
|
||||
playing = false;
|
||||
SetUpFinalScreen();
|
||||
SetPort((GrafPtr)mainWindow);
|
||||
SetPort(mainWindow->GetDrawSurface());
|
||||
ColorRect(surface, mainWindowRect, 244);
|
||||
DoGameOverStarAnimation();
|
||||
if (!TestHighScore())
|
||||
@@ -87,6 +89,9 @@ void SetUpFinalScreen (void)
|
||||
short count, offset, i, textDown;
|
||||
char wasState;
|
||||
DrawSurface *surface = workSrcMap;
|
||||
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
|
||||
ColorRect(surface, workSrcRect, 244);
|
||||
QSetRect(&tempRect, 0, 0, 640, 460);
|
||||
@@ -103,18 +108,16 @@ void SetUpFinalScreen (void)
|
||||
{
|
||||
GetLineOfText(tempStr, count, subStr);
|
||||
|
||||
surface->SetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
offset = ((thisMac.constrainedScreen.right - thisMac.constrainedScreen.left) -
|
||||
surface->MeasureString(subStr)) / 2;
|
||||
appFont->MeasurePStr(subStr)) / 2;
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
|
||||
const Point textShadowPos = Point::Create(offset + 1, textDown + 33 + (count * 20));
|
||||
|
||||
surface->DrawString(textShadowPos, subStr, true);
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(255, 255, 255, 255));
|
||||
surface->DrawString(textShadowPos, subStr, blackColor, appFont);
|
||||
|
||||
const Point textPos = Point::Create(offset, textDown + 32 + (count * 20));
|
||||
surface->DrawString(textPos, subStr, true);
|
||||
surface->DrawString(textPos, subStr, whiteColor, appFont);
|
||||
count++;
|
||||
}
|
||||
while (subStr[0] > 0);
|
||||
@@ -159,7 +162,7 @@ void DoGameOverStarAnimation (void)
|
||||
nextLoop = TickCount() + 2;
|
||||
count = 0;
|
||||
pass = 0;
|
||||
FlushEvents(everyEvent, 0);
|
||||
FlushEvents();
|
||||
|
||||
if (workSrcRect.bottom - angelDest.bottom > kMaxFramesAlive * starFallSpeed)
|
||||
starFallSpeed = (workSrcRect.bottom - angelDest.bottom + kMaxFramesAlive - 1) / kMaxFramesAlive;
|
||||
@@ -461,7 +464,7 @@ void DoDiedGameOver (void)
|
||||
InitDiedGameOver();
|
||||
CopyRectMainToWork(&workSrcRect);
|
||||
CopyRectMainToBack(&workSrcRect);
|
||||
FlushEvents(everyEvent, 0);
|
||||
FlushEvents();
|
||||
|
||||
nextLoop = TickCount() + 2;
|
||||
while (pagesStuck < 8)
|
||||
|
||||
@@ -621,3 +621,10 @@ static const Boolean kFaceLeft = FALSE; // Conflicts with GP input driver
|
||||
#define kDemoLength 6702
|
||||
|
||||
#define kGamepadDeadzone 4096 // Out of 32768
|
||||
|
||||
#define kDefaultComponent 0
|
||||
#define kCandleFlameComponent 1
|
||||
#define kTikiFlamesComponent 1
|
||||
#define kBBQCoalsComponent 1
|
||||
#define kPendulumComponent 1
|
||||
#define kStarComponent 1
|
||||
|
||||
@@ -23,10 +23,10 @@ void CloseCoordWindow (void);
|
||||
void ToggleCoordinateWindow (void);
|
||||
|
||||
void NilSavedMaps (void); // --- DynamicMaps.c
|
||||
SInt16 BackUpToSavedMap (Rect *, SInt16, SInt16);
|
||||
SInt16 ReBackUpSavedMap (Rect *, SInt16, SInt16);
|
||||
SInt16 BackUpToSavedMap (Rect *theRect, SInt16 where, SInt16 who, SInt16 component);
|
||||
SInt16 ReBackUpSavedMap (Rect *theRect, SInt16 where, SInt16 who, SInt16 component);
|
||||
SInt16 RemoveFromSavedMap(SInt16);
|
||||
void RestoreFromSavedMap (SInt16, SInt16, Boolean);
|
||||
void RestoreFromSavedMap (SInt16 where, SInt16 who, SInt16 component, Boolean doSparkle);
|
||||
void AddSparkle (Rect *);
|
||||
void AddFlyingPoint (Rect *, SInt16, SInt16, SInt16);
|
||||
Boolean ReBackUpFlames (SInt16, SInt16, SInt16, SInt16);
|
||||
@@ -156,10 +156,9 @@ void RedrawSplashScreen (void); // --- MainWindow.c
|
||||
void UpdateMainWindow (void);
|
||||
void OpenMainWindow (void);
|
||||
void CloseMainWindow (void);
|
||||
void ZoomBetweenWindows (void);
|
||||
void UpdateEditWindowTitle (void);
|
||||
void HandleMainClick (Point, Boolean);
|
||||
//void WashColorIn (void);
|
||||
void WashColorIn (void);
|
||||
|
||||
void CenterMapOnRoom (SInt16, SInt16); // --- Map.c
|
||||
Boolean ThisRoomVisibleOnMap (void);
|
||||
|
||||
@@ -241,6 +241,7 @@ typedef struct
|
||||
DrawSurface *map;
|
||||
short where;
|
||||
short who;
|
||||
short component;
|
||||
} savedType, *savedPtr;
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<Import Project="GpApp.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.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" />
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "HostFileSystem.h"
|
||||
#include "HostFontHandler.h"
|
||||
#include "HostDisplayDriver.h"
|
||||
#include "HostLogDriver.h"
|
||||
#include "HostSystemServices.h"
|
||||
#include "HostVOSEventQueue.h"
|
||||
#include "MenuManager.h"
|
||||
@@ -22,6 +23,7 @@ public:
|
||||
void PL_HostDisplayDriver_SetInstance(IGpDisplayDriver *instance) override;
|
||||
void PL_HostSystemServices_SetInstance(PortabilityLayer::HostSystemServices *instance) override;
|
||||
void PL_HostAudioDriver_SetInstance(IGpAudioDriver *instance) override;
|
||||
void PL_HostLogDriver_SetInstance(IGpLogDriver *instance) override;
|
||||
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;
|
||||
@@ -55,6 +57,11 @@ void GpAppInterfaceImpl::PL_HostDisplayDriver_SetInstance(IGpDisplayDriver *inst
|
||||
PortabilityLayer::HostDisplayDriver::SetInstance(instance);
|
||||
}
|
||||
|
||||
void GpAppInterfaceImpl::PL_HostLogDriver_SetInstance(IGpLogDriver *instance)
|
||||
{
|
||||
PortabilityLayer::HostLogDriver::SetInstance(instance);
|
||||
}
|
||||
|
||||
void GpAppInterfaceImpl::PL_HostSystemServices_SetInstance(PortabilityLayer::HostSystemServices *instance)
|
||||
{
|
||||
PortabilityLayer::HostSystemServices::SetInstance(instance);
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
#include "Environ.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Objects.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "Room.h"
|
||||
|
||||
|
||||
@@ -102,9 +104,11 @@ void HandleGrease (void)
|
||||
}
|
||||
|
||||
{
|
||||
backSrcMap->FillRect(src);
|
||||
|
||||
workSrcMap->FillRect(src);
|
||||
PortabilityLayer::ResolveCachingColor blackColorBack = StdColors::Black();
|
||||
backSrcMap->FillRect(src, blackColorBack);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor blackColorWork = StdColors::Black();
|
||||
workSrcMap->FillRect(src, blackColorWork);
|
||||
AddRectToWorkRects(&src);
|
||||
}
|
||||
|
||||
@@ -213,7 +217,7 @@ short AddGrease (short where, short who, short h, short v,
|
||||
QOffsetRect(&src, h, v);
|
||||
|
||||
QSetRect(&bounds, 0, 0, 32, 27 * 4);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who);
|
||||
savedNum = BackUpToSavedMap(&bounds, where, who, kDefaultComponent);
|
||||
if (savedNum != -1)
|
||||
{
|
||||
BackupGrease (&src, savedNum, isRight);
|
||||
@@ -282,13 +286,16 @@ void RedrawAllGrease (void)
|
||||
if ((grease[i].where == thisRoomNumber) &&
|
||||
((src.bottom - src.top) == 2))
|
||||
{
|
||||
PortabilityLayer::ResolveCachingColor blackColorBack = StdColors::Black();
|
||||
PortabilityLayer::ResolveCachingColor blackColorWork = StdColors::Black();
|
||||
|
||||
QOffsetRect(&src, playOriginH, playOriginV);
|
||||
|
||||
wasCPort = GetGraphicsPort();
|
||||
|
||||
backSrcMap->FillRect(src);
|
||||
backSrcMap->FillRect(src, blackColorBack);
|
||||
|
||||
workSrcMap->FillRect(src);
|
||||
workSrcMap->FillRect(src, blackColorWork);
|
||||
AddRectToWorkRects(&src);
|
||||
|
||||
SetGraphicsPort(wasCPort);
|
||||
@@ -332,5 +339,5 @@ void RemapGreaseSavedMap(SInt16 removedItem, SInt16 substituteItem)
|
||||
grease[i].mapNum = removedItem;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "PLHacks.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLNumberFormatting.h"
|
||||
#include "PLScript.h"
|
||||
#include "PLSound.h"
|
||||
#include "PLStringCompare.h"
|
||||
#include "DialogUtils.h"
|
||||
@@ -22,10 +21,13 @@
|
||||
#include "House.h"
|
||||
#include "IOStream.h"
|
||||
#include "MainWindow.h"
|
||||
#include "RectUtils.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
#include "RectUtils.h"
|
||||
#include "RenderedFont.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "Utilities.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
@@ -68,11 +70,11 @@ extern Boolean quickerTransitions, resumedSavedGame;
|
||||
void DoHighScores (void)
|
||||
{
|
||||
Rect tempRect;
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
|
||||
SpinCursor(3);
|
||||
SetPort(&workSrcMap->m_port);
|
||||
workSrcMap->SetForeColor(StdColors::Black());
|
||||
workSrcMap->FillRect(workSrcRect);
|
||||
SetPort(workSrcMap);
|
||||
workSrcMap->FillRect(workSrcRect, blackColor);
|
||||
QSetRect(&tempRect, 0, 0, 640, 480);
|
||||
QOffsetRect(&tempRect, splashOriginH, splashOriginV);
|
||||
LoadScaledGraphic(workSrcMap, kStarPictID, &tempRect);
|
||||
@@ -119,11 +121,11 @@ void DrawHighScores (DrawSurface *surface)
|
||||
Str255 tempStr;
|
||||
short scoreLeft, bannerWidth, i, dropIt;
|
||||
char wasState;
|
||||
PortabilityLayer::RGBAColor blackColor = PortabilityLayer::RGBAColor::Create(0, 0, 0, 255);
|
||||
PortabilityLayer::RGBAColor yellowColor = PortabilityLayer::RGBAColor::Create(255, 255, 0, 255);
|
||||
PortabilityLayer::RGBAColor cyanColor = PortabilityLayer::RGBAColor::Create(0, 255, 255, 255);
|
||||
PortabilityLayer::RGBAColor whiteColor = PortabilityLayer::RGBAColor::Create(255, 255, 255, 255);
|
||||
PortabilityLayer::RGBAColor blueColor = PortabilityLayer::RGBAColor::Create(0, 0, 255, 255);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = PortabilityLayer::RGBAColor::Create(0, 0, 0, 255);
|
||||
PortabilityLayer::ResolveCachingColor yellowColor = PortabilityLayer::RGBAColor::Create(255, 255, 0, 255);
|
||||
PortabilityLayer::ResolveCachingColor cyanColor = PortabilityLayer::RGBAColor::Create(0, 255, 255, 255);
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = PortabilityLayer::RGBAColor::Create(255, 255, 255, 255);
|
||||
PortabilityLayer::ResolveCachingColor blueColor = PortabilityLayer::RGBAColor::Create(0, 0, 255, 255);
|
||||
|
||||
scoreLeft = ((thisMac.constrainedScreen.right - thisMac.constrainedScreen.left) - kScoreWide) / 2;
|
||||
dropIt = 129 + splashOriginV;
|
||||
@@ -146,43 +148,37 @@ void DrawHighScores (DrawSurface *surface)
|
||||
DisposeGWorld(tempMap);
|
||||
DisposeGWorld(tempMask);
|
||||
|
||||
surface->SetApplicationFont(14, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
PortabilityLayer::RenderedFont *appFont14 = GetApplicationFont(14, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
PasStringCopy(PSTR("¥ "), tempStr);
|
||||
PasStringConcat(tempStr, thisHouseName);
|
||||
PasStringConcat(tempStr, PSTR(" ¥"));
|
||||
|
||||
const Point scoreShadowPoint = Point::Create(scoreLeft + ((kScoreWide - surface->MeasureString(tempStr)) / 2) - 1, dropIt - 66);
|
||||
surface->SetForeColor(blackColor);
|
||||
surface->DrawString(scoreShadowPoint, tempStr, true);
|
||||
const Point scoreShadowPoint = Point::Create(scoreLeft + ((kScoreWide - appFont14->MeasurePStr(tempStr)) / 2) - 1, dropIt - 66);
|
||||
surface->DrawString(scoreShadowPoint, tempStr, blackColor, appFont14);
|
||||
|
||||
const Point scoreTextPoint = Point::Create(scoreLeft + ((kScoreWide - surface->MeasureString(tempStr)) / 2), dropIt - 65);
|
||||
surface->SetForeColor(cyanColor);
|
||||
surface->DrawString(scoreTextPoint, tempStr, true);
|
||||
const Point scoreTextPoint = Point::Create(scoreLeft + ((kScoreWide - appFont14->MeasurePStr(tempStr)) / 2), dropIt - 65);
|
||||
surface->DrawString(scoreTextPoint, tempStr, cyanColor, appFont14);
|
||||
|
||||
surface->SetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
PortabilityLayer::RenderedFont *appFont12 = GetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
thisHousePtr = *thisHouse;
|
||||
// message for score #1
|
||||
PasStringCopy(thisHousePtr->highScores.banner, tempStr);
|
||||
bannerWidth = surface->MeasureString(tempStr);
|
||||
surface->SetForeColor(blackColor);
|
||||
bannerWidth = appFont12->MeasurePStr(tempStr);
|
||||
const Point topScoreShadowPoint = Point::Create(scoreLeft + (kScoreWide - bannerWidth) / 2, dropIt - kKimsLifted);
|
||||
surface->DrawString(topScoreShadowPoint, tempStr, true);
|
||||
surface->DrawString(topScoreShadowPoint, tempStr, blackColor, appFont12);
|
||||
|
||||
surface->SetForeColor(yellowColor);
|
||||
const Point topScoreTextPoint = Point::Create(scoreLeft + (kScoreWide - bannerWidth) / 2, dropIt - kKimsLifted - 1);
|
||||
surface->DrawString(topScoreTextPoint, tempStr, true);
|
||||
surface->DrawString(topScoreTextPoint, tempStr, yellowColor, appFont12);
|
||||
|
||||
QSetRect(&tempRect, 0, 0, bannerWidth + 8, kScoreSpacing);
|
||||
QOffsetRect(&tempRect, scoreLeft - 3 + (kScoreWide - bannerWidth) / 2,
|
||||
dropIt + 5 - kScoreSpacing - kKimsLifted);
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
|
||||
surface->FrameRect(tempRect);
|
||||
surface->FrameRect(tempRect, blackColor);
|
||||
QOffsetRect(&tempRect, -1, -1);
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(255, 255, 0, 255));
|
||||
surface->FrameRect(tempRect);
|
||||
surface->FrameRect(tempRect, yellowColor);
|
||||
|
||||
for (i = 0; i < kMaxScores; i++)
|
||||
{
|
||||
@@ -192,101 +188,90 @@ void DrawHighScores (DrawSurface *surface)
|
||||
|
||||
SpinCursor(1);
|
||||
NumToString((long)i + 1L, tempStr); // draw placing number
|
||||
surface->SetForeColor(blackColor);
|
||||
if (i == 0)
|
||||
strPos = Point::Create(scoreLeft + 1, dropIt - kScoreSpacing - kKimsLifted);
|
||||
else
|
||||
strPos = Point::Create(scoreLeft + 1, dropIt + (i * kScoreSpacing));
|
||||
surface->DrawString(strPos, tempStr, true);
|
||||
if (i == lastHighScore)
|
||||
surface->SetForeColor(whiteColor);
|
||||
else
|
||||
surface->SetForeColor(cyanColor);
|
||||
surface->DrawString(strPos, tempStr, blackColor, appFont12);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor *scoreColor = (i == lastHighScore) ? &whiteColor : &cyanColor;
|
||||
|
||||
if (i == 0)
|
||||
strPos = Point::Create(scoreLeft + 0, dropIt - 1 - kScoreSpacing - kKimsLifted);
|
||||
else
|
||||
strPos = Point::Create(scoreLeft + 0, dropIt - 1 + (i * kScoreSpacing));
|
||||
surface->DrawString(strPos, tempStr, true);
|
||||
surface->DrawString(strPos, tempStr, *scoreColor, appFont12);
|
||||
// draw high score name
|
||||
PasStringCopy(thisHousePtr->highScores.names[i], tempStr);
|
||||
surface->SetForeColor(blackColor);
|
||||
|
||||
if (i == 0)
|
||||
strPos = Point::Create(scoreLeft + 31, dropIt - kScoreSpacing - kKimsLifted);
|
||||
else
|
||||
strPos = Point::Create(scoreLeft + 31, dropIt + (i * kScoreSpacing));
|
||||
surface->DrawString(strPos, tempStr, true);
|
||||
if (i == lastHighScore)
|
||||
surface->SetForeColor(whiteColor);
|
||||
else
|
||||
surface->SetForeColor(yellowColor);
|
||||
surface->DrawString(strPos, tempStr, blackColor, appFont12);
|
||||
|
||||
|
||||
PortabilityLayer::ResolveCachingColor *nameColor = (i == lastHighScore) ? &whiteColor : &yellowColor;
|
||||
|
||||
if (i == 0)
|
||||
strPos = Point::Create(scoreLeft + 30, dropIt - 1 - kScoreSpacing - kKimsLifted);
|
||||
else
|
||||
strPos = Point::Create(scoreLeft + 30, dropIt - 1 + (i * kScoreSpacing));
|
||||
surface->DrawString(strPos, tempStr, true);
|
||||
surface->DrawString(strPos, tempStr, *nameColor, appFont12);
|
||||
// draw level number
|
||||
NumToString(thisHousePtr->highScores.levels[i], tempStr);
|
||||
surface->SetForeColor(blackColor);
|
||||
|
||||
if (i == 0)
|
||||
strPos = Point::Create(scoreLeft + 161, dropIt - kScoreSpacing - kKimsLifted);
|
||||
else
|
||||
strPos = Point::Create(scoreLeft + 161, dropIt + (i * kScoreSpacing));
|
||||
surface->DrawString(strPos, tempStr, true);
|
||||
if (i == lastHighScore)
|
||||
surface->SetForeColor(whiteColor);
|
||||
else
|
||||
surface->SetForeColor(yellowColor);
|
||||
surface->DrawString(strPos, tempStr, blackColor, appFont12);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor *levelColor = (i == lastHighScore) ? &whiteColor : &yellowColor;
|
||||
if (i == 0)
|
||||
strPos = Point::Create(scoreLeft + 160, dropIt - 1 - kScoreSpacing - kKimsLifted);
|
||||
else
|
||||
strPos = Point::Create(scoreLeft + 160, dropIt - 1 + (i * kScoreSpacing));
|
||||
surface->DrawString(strPos, tempStr, true);
|
||||
surface->DrawString(strPos, tempStr, *levelColor, appFont12);
|
||||
// draw word "rooms"
|
||||
if (thisHousePtr->highScores.levels[i] == 1)
|
||||
GetLocalizedString(6, tempStr);
|
||||
else
|
||||
GetLocalizedString(7, tempStr);
|
||||
surface->SetForeColor(blackColor);
|
||||
|
||||
if (i == 0)
|
||||
strPos = Point::Create(scoreLeft + 193, dropIt - kScoreSpacing - kKimsLifted);
|
||||
else
|
||||
strPos = Point::Create(scoreLeft + 193, dropIt + (i * kScoreSpacing));
|
||||
surface->DrawString(strPos, tempStr, true);
|
||||
surface->SetForeColor(cyanColor);
|
||||
surface->DrawString(strPos, tempStr, blackColor, appFont12);
|
||||
if (i == 0)
|
||||
strPos = Point::Create(scoreLeft + 192, dropIt - 1 - kScoreSpacing - kKimsLifted);
|
||||
else
|
||||
strPos = Point::Create(scoreLeft + 192, dropIt - 1 + (i * kScoreSpacing));
|
||||
surface->DrawString(strPos, tempStr, true);
|
||||
surface->DrawString(strPos, tempStr, cyanColor, appFont12);
|
||||
// draw high score points
|
||||
NumToString(thisHousePtr->highScores.scores[i], tempStr);
|
||||
surface->SetForeColor(blackColor);
|
||||
if (i == 0)
|
||||
strPos = Point::Create(scoreLeft + 291, dropIt - kScoreSpacing - kKimsLifted);
|
||||
else
|
||||
strPos = Point::Create(scoreLeft + 291, dropIt + (i * kScoreSpacing));
|
||||
surface->DrawString(strPos, tempStr, true);
|
||||
if (i == lastHighScore)
|
||||
surface->SetForeColor(whiteColor);
|
||||
else
|
||||
surface->SetForeColor(yellowColor);
|
||||
surface->DrawString(strPos, tempStr, blackColor, appFont12);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor *pointsColor = (i == lastHighScore) ? &whiteColor : &yellowColor;
|
||||
|
||||
if (i == 0)
|
||||
strPos = Point::Create(scoreLeft + 290, dropIt - 1 - kScoreSpacing - kKimsLifted);
|
||||
else
|
||||
strPos = Point::Create(scoreLeft + 290, dropIt - 1 + (i * kScoreSpacing));
|
||||
surface->DrawString(strPos, tempStr, true);
|
||||
surface->DrawString(strPos, tempStr, *pointsColor, appFont12);
|
||||
}
|
||||
}
|
||||
|
||||
surface->SetForeColor(blueColor);
|
||||
|
||||
surface->SetApplicationFont(9, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
PortabilityLayer::RenderedFont *appFont9 = GetApplicationFont(9, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
const Point textPos = Point::Create(scoreLeft + 80, dropIt - 1 + (10 * kScoreSpacing));
|
||||
GetLocalizedString(8, tempStr);
|
||||
surface->DrawString(textPos, tempStr, true);
|
||||
|
||||
surface->SetForeColor(blackColor);
|
||||
surface->DrawString(textPos, tempStr, blueColor, appFont9);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- SortHighScores
|
||||
@@ -411,7 +396,7 @@ Boolean TestHighScore (void)
|
||||
else if (scoreTimestamp > 0xffffffff)
|
||||
scoreTimestamp = 0xffffffff;
|
||||
|
||||
FlushEvents(everyEvent, 0);
|
||||
FlushEvents();
|
||||
GetHighScoreName(placing + 1);
|
||||
PasStringCopy(highName, thisHousePtr->highScores.names[kMaxScores - 1]);
|
||||
if (placing == 0)
|
||||
@@ -506,6 +491,8 @@ void GetHighScoreName (short place)
|
||||
Str255 scoreStr, placeStr, tempStr;
|
||||
short item;
|
||||
Boolean leaving;
|
||||
|
||||
PortabilityLayer::WindowManager *wm = PortabilityLayer::WindowManager::GetInstance();
|
||||
|
||||
InitCursor();
|
||||
NumToString(theScore, scoreStr);
|
||||
@@ -515,13 +502,19 @@ void GetHighScoreName (short place)
|
||||
|
||||
PlayPrioritySound(kEnergizeSound, kEnergizePriority);
|
||||
BringUpDialog(&theDial, kHighNameDialogID, &substitutions);
|
||||
FlushEvents(everyEvent, 0);
|
||||
FlushEvents();
|
||||
SetDialogString(theDial, kHighNameItem, highName);
|
||||
SelectDialogItemText(theDial, kHighNameItem, 0, 1024);
|
||||
leaving = false;
|
||||
|
||||
UpdateNameDialog(theDial);
|
||||
|
||||
Window *exclStack = theDial->GetWindow();
|
||||
wm->SwapExclusiveWindow(exclStack); // Push exclusive window for zooms
|
||||
|
||||
if (doZooms)
|
||||
wm->FlickerWindowIn(theDial->GetWindow(), 64);
|
||||
|
||||
while (!leaving)
|
||||
{
|
||||
item = theDial->ExecuteModal(NameFilter);
|
||||
@@ -533,6 +526,11 @@ void GetHighScoreName (short place)
|
||||
leaving = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (doZooms)
|
||||
wm->FlickerWindowOut(theDial->GetWindow(), 64);
|
||||
|
||||
wm->SwapExclusiveWindow(exclStack); // Pop exclusive window
|
||||
|
||||
theDial->Destroy();
|
||||
}
|
||||
@@ -610,6 +608,8 @@ void GetHighScoreBanner (void)
|
||||
Str255 tempStr;
|
||||
short item;
|
||||
Boolean leaving;
|
||||
|
||||
PortabilityLayer::WindowManager *wm = PortabilityLayer::WindowManager::GetInstance();
|
||||
|
||||
PlayPrioritySound(kEnergizeSound, kEnergizePriority);
|
||||
BringUpDialog(&theDial, kHighBannerDialogID, nullptr);
|
||||
@@ -618,7 +618,13 @@ void GetHighScoreBanner (void)
|
||||
leaving = false;
|
||||
|
||||
UpdateBannerDialog(theDial);
|
||||
|
||||
|
||||
Window *exclStack = theDial->GetWindow();
|
||||
wm->SwapExclusiveWindow(exclStack); // Push exclusive window for zooms
|
||||
|
||||
if (doZooms)
|
||||
wm->FlickerWindowIn(theDial->GetWindow(), 64);
|
||||
|
||||
while (!leaving)
|
||||
{
|
||||
item = theDial->ExecuteModal(BannerFilter);
|
||||
@@ -630,6 +636,11 @@ void GetHighScoreBanner (void)
|
||||
leaving = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (doZooms)
|
||||
wm->FlickerWindowOut(theDial->GetWindow(), 64);
|
||||
|
||||
wm->SwapExclusiveWindow(exclStack); // Pop exclusive window
|
||||
|
||||
theDial->Destroy();
|
||||
}
|
||||
@@ -703,6 +714,8 @@ Boolean WriteScoresToDisk (void)
|
||||
|
||||
scoresStream->Close();
|
||||
|
||||
gameDirty = false;
|
||||
|
||||
return (true);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
//============================================================================
|
||||
|
||||
#include "PLAppleEvents.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLNavigation.h"
|
||||
#include "PLNumberFormatting.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "PLResources.h"
|
||||
@@ -17,6 +15,7 @@
|
||||
#include "FileManager.h"
|
||||
#include "HostFileSystem.h"
|
||||
#include "House.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResourceManager.h"
|
||||
@@ -55,9 +54,7 @@ extern Boolean twoPlayerGame, wardBitSet, phoneBitSet;
|
||||
#ifndef COMPILEDEMO
|
||||
Boolean CreateNewHouse (void)
|
||||
{
|
||||
AEKeyword theKeyword;
|
||||
DescType actualType;
|
||||
Size actualSize;
|
||||
size_t actualSize;
|
||||
VFileSpec tempSpec;
|
||||
VFileSpec theSpec;
|
||||
PLError_t theErr;
|
||||
@@ -730,7 +727,7 @@ void ConvertHouseVer1To2 (void)
|
||||
NumToString((long)i, roomStr);
|
||||
GetLocalizedString(14, message);
|
||||
PasStringConcat(message, roomStr);
|
||||
SetMessageWindowMessage(message);
|
||||
SetMessageWindowMessage(message, StdColors::Black());
|
||||
SpinCursor(1);
|
||||
|
||||
ForceThisRoom(i);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
//============================================================================
|
||||
|
||||
|
||||
#include "PLMacTypes.h"
|
||||
#include "PLCore.h"
|
||||
|
||||
|
||||
extern Str32 thisHouseName;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "PLMovies.h"
|
||||
#include "PLResources.h"
|
||||
#include "PLStringCompare.h"
|
||||
#include "PLTextUtils.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "BitmapImage.h"
|
||||
#include "DialogManager.h"
|
||||
@@ -614,20 +613,6 @@ Boolean ReadHouse (void)
|
||||
YellowAlert(kYellowUnaccounted, 2);
|
||||
return (false);
|
||||
}
|
||||
|
||||
if (gameDirty || fileDirty)
|
||||
{
|
||||
if (houseIsReadOnly)
|
||||
{
|
||||
if (!WriteScoresToDisk())
|
||||
{
|
||||
YellowAlert(kYellowFailedWrite, 0);
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
else if (!WriteHouse(false))
|
||||
return(false);
|
||||
}
|
||||
|
||||
byteCount = houseStream->Size();
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ int16_t HouseFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
if (mouseEvt.m_eventType == GpMouseEventTypes::kMove)
|
||||
{
|
||||
mouseIs = Point::Create(mouseEvt.m_x, mouseEvt.m_y);
|
||||
mouseIs -= dial->GetWindow()->TopLeftCoord();
|
||||
mouseIs -= dial->GetWindow()->GetTopLeftCoord();
|
||||
if ((houseEditText1.Contains(mouseIs)) ||
|
||||
(houseEditText2.Contains(mouseIs)))
|
||||
{
|
||||
@@ -231,7 +231,7 @@ void DoHouseInfo (void)
|
||||
houseInfoDialog = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kHouseInfoDialogID, kPutInFront, &substitutions);
|
||||
if (houseInfoDialog == nil)
|
||||
RedAlert(kErrDialogDidntLoad);
|
||||
SetPort(&houseInfoDialog->GetWindow()->GetDrawSurface()->m_port);
|
||||
SetPort(houseInfoDialog->GetWindow()->GetDrawSurface());
|
||||
ShowWindow(houseInfoDialog->GetWindow());
|
||||
|
||||
static_cast<PortabilityLayer::EditboxWidget*>(houseInfoDialog->GetItems()[kBannerTextItem - 1].GetWidget())->SetMultiLine(true);
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
|
||||
#include "PLNumberFormatting.h"
|
||||
#include "PLStringCompare.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "Externs.h"
|
||||
#include "ObjectEdit.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "RectUtils.h"
|
||||
|
||||
|
||||
@@ -739,9 +741,8 @@ void LopOffExtraRooms (void)
|
||||
newSize = sizeof(houseType) + (sizeof(roomType) * (long)r);
|
||||
if (SetHandleSize(thisHouse.StaticCast<void>(), newSize) != PLErrors::kNone) // resize house handle (shrink)
|
||||
{
|
||||
ForeColor(redColor);
|
||||
GetLocalizedString(16, message);
|
||||
SetMessageWindowMessage(message);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
}
|
||||
(*thisHouse)->nRooms -= count;
|
||||
numberRooms = (*thisHouse)->nRooms;
|
||||
@@ -772,21 +773,17 @@ void ValidateRoomNumbers (void)
|
||||
((*thisHouse)->rooms[i].floor < -7))
|
||||
{
|
||||
(*thisHouse)->rooms[i].suite = kRoomIsEmpty;
|
||||
ForeColor(redColor);
|
||||
GetLocalizedString(17, message);
|
||||
SetMessageWindowMessage(message);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
houseErrors++;
|
||||
ForeColor(blackColor);
|
||||
}
|
||||
if (((*thisHouse)->rooms[i].suite >= 128) ||
|
||||
((*thisHouse)->rooms[i].suite < 0))
|
||||
{
|
||||
(*thisHouse)->rooms[i].suite = kRoomIsEmpty;
|
||||
ForeColor(redColor);
|
||||
GetLocalizedString(18, message);
|
||||
SetMessageWindowMessage(message);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
houseErrors++;
|
||||
ForeColor(blackColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -885,11 +882,9 @@ void KeepAllObjectsLegal (void)
|
||||
{
|
||||
if (!KeepObjectLegal())
|
||||
{
|
||||
ForeColor(redColor);
|
||||
GetLocalizedString(19, message);
|
||||
SetMessageWindowMessage(message);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
houseErrors++;
|
||||
ForeColor(blackColor);
|
||||
DelayTicks(60);
|
||||
}
|
||||
}
|
||||
@@ -923,10 +918,8 @@ void CheckForStaircasePairs (void)
|
||||
neighbor = GetNeighborRoomNumber(kNorthRoom);
|
||||
if (neighbor == kRoomIsEmpty)
|
||||
{
|
||||
ForeColor(redColor);
|
||||
GetLocalizedString(20, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
DelayTicks(60);
|
||||
}
|
||||
else
|
||||
@@ -940,10 +933,8 @@ void CheckForStaircasePairs (void)
|
||||
}
|
||||
if (!hasStairs)
|
||||
{
|
||||
ForeColor(redColor);
|
||||
GetLocalizedString(21, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
DelayTicks(60);
|
||||
}
|
||||
}
|
||||
@@ -954,10 +945,8 @@ void CheckForStaircasePairs (void)
|
||||
neighbor = GetNeighborRoomNumber(kSouthRoom);
|
||||
if (neighbor == kRoomIsEmpty)
|
||||
{
|
||||
ForeColor(redColor);
|
||||
GetLocalizedString(22, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
DelayTicks(60);
|
||||
}
|
||||
else
|
||||
@@ -971,10 +960,8 @@ void CheckForStaircasePairs (void)
|
||||
}
|
||||
if (!hasStairs)
|
||||
{
|
||||
ForeColor(redColor);
|
||||
GetLocalizedString(23, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
DelayTicks(60);
|
||||
}
|
||||
}
|
||||
@@ -1004,19 +991,19 @@ void CheckHouseForProblems (void)
|
||||
|
||||
SpinCursor(3);
|
||||
GetLocalizedString(25, message);
|
||||
SetMessageWindowMessage(message);
|
||||
SetMessageWindowMessage(message, StdColors::Black());
|
||||
WrapBannerAndTrailer();
|
||||
|
||||
if (isHouseChecks)
|
||||
{
|
||||
SpinCursor(3);
|
||||
GetLocalizedString(26, message);
|
||||
SetMessageWindowMessage(message);
|
||||
SetMessageWindowMessage(message, StdColors::Black());
|
||||
ValidateNumberOfRooms();
|
||||
if (houseErrors != 0)
|
||||
{
|
||||
GetLocalizedString(27, message);
|
||||
SetMessageWindowMessage(message);
|
||||
SetMessageWindowMessage(message, StdColors::Black());
|
||||
DelayTicks(60);
|
||||
houseErrors = 0;
|
||||
}
|
||||
@@ -1032,9 +1019,7 @@ void CheckHouseForProblems (void)
|
||||
NumToString((long)houseErrors, message);
|
||||
GetLocalizedString(28, message2);
|
||||
PasStringConcat(message, message2);
|
||||
ForeColor(redColor);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
DelayTicks(45);
|
||||
}
|
||||
}
|
||||
@@ -1053,9 +1038,7 @@ void CheckHouseForProblems (void)
|
||||
NumToString((long)houseErrors, message);
|
||||
GetLocalizedString(29, message2);
|
||||
PasStringConcat(message, message2);
|
||||
ForeColor(redColor);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
DelayTicks(60);
|
||||
}
|
||||
}
|
||||
@@ -1070,9 +1053,7 @@ void CheckHouseForProblems (void)
|
||||
NumToString((long)houseErrors, message);
|
||||
GetLocalizedString(30, message2);
|
||||
PasStringConcat(message, message2);
|
||||
ForeColor(blueColor);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(45);
|
||||
}
|
||||
}
|
||||
@@ -1087,9 +1068,7 @@ void CheckHouseForProblems (void)
|
||||
NumToString((long)houseErrors, message);
|
||||
GetLocalizedString(31, message2);
|
||||
PasStringConcat(message, message2);
|
||||
ForeColor(blueColor);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(45);
|
||||
}
|
||||
}
|
||||
@@ -1104,9 +1083,7 @@ void CheckHouseForProblems (void)
|
||||
NumToString((long)houseErrors, message);
|
||||
GetLocalizedString(32, message2);
|
||||
PasStringConcat(message, message2);
|
||||
ForeColor(redColor);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
DelayTicks(60);
|
||||
}
|
||||
}
|
||||
@@ -1116,16 +1093,14 @@ void CheckHouseForProblems (void)
|
||||
SpinCursor(3);
|
||||
houseErrors = 0;
|
||||
GetLocalizedString(33, message);
|
||||
SetMessageWindowMessage(message);
|
||||
SetMessageWindowMessage(message, StdColors::Black());
|
||||
KeepAllObjectsLegal();
|
||||
if (houseErrors != 0)
|
||||
{
|
||||
NumToString((long)houseErrors, message);
|
||||
GetLocalizedString(34, message2);
|
||||
PasStringConcat(message, message2);
|
||||
ForeColor(redColor);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
DelayTicks(60);
|
||||
}
|
||||
}
|
||||
@@ -1142,10 +1117,8 @@ void CheckHouseForProblems (void)
|
||||
SpinCursor(3);
|
||||
if (CountStarsInHouse() < 1)
|
||||
{
|
||||
ForeColor(redColor);
|
||||
GetLocalizedString(35, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Red());
|
||||
DelayTicks(60);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
//============================================================================
|
||||
|
||||
|
||||
#include "PLToolUtils.h"
|
||||
#include "PLDialogs.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "DialogManager.h"
|
||||
@@ -89,9 +88,9 @@ void DoPause (void)
|
||||
QSetRect(&bounds, 0, 0, 214, 54);
|
||||
CenterRectInRect(&bounds, &houseRect);
|
||||
if (isEscPauseKey)
|
||||
LoadScaledGraphic(surface, kEscPausePictID, &bounds);
|
||||
LoadScaledGraphicCustom(surface, kEscPausePictID, &bounds);
|
||||
else
|
||||
LoadScaledGraphic(surface, kTabPausePictID, &bounds);
|
||||
LoadScaledGraphicCustom(surface, kTabPausePictID, &bounds);
|
||||
|
||||
const KeyDownStates *theKeys = nullptr;
|
||||
|
||||
@@ -119,7 +118,7 @@ void DoPause (void)
|
||||
}
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
|
||||
&bounds, &bounds, srcCopy);
|
||||
|
||||
do
|
||||
@@ -468,7 +467,7 @@ Boolean QuerySaveGame (void)
|
||||
short hitWhat;
|
||||
|
||||
InitCursor();
|
||||
FlushEvents(everyEvent, 0);
|
||||
FlushEvents();
|
||||
// CenterAlert(kSaveGameAlert);
|
||||
hitWhat = PortabilityLayer::DialogManager::GetInstance()->DisplayAlert(kSaveGameAlert, nullptr);
|
||||
if (hitWhat == kYesSaveGameButton)
|
||||
|
||||
@@ -769,7 +769,7 @@ void HandleRewards (gliderPtr thisGlider, hotPtr who)
|
||||
{
|
||||
PlayPrioritySound(kBeepsSound, kBeepsPriority);
|
||||
RestoreFromSavedMap(thisRoomNumber,
|
||||
masterObjects[whoLinked].objectNum, false);
|
||||
masterObjects[whoLinked].objectNum, kDefaultComponent, false);
|
||||
AddFlyingPoint(&bounds, 100, thisGlider->hVel / 2, thisGlider->vVel / 2);
|
||||
thisGlider->hVel /= 4;
|
||||
thisGlider->vVel /= 4;
|
||||
@@ -785,7 +785,7 @@ void HandleRewards (gliderPtr thisGlider, hotPtr who)
|
||||
{
|
||||
PlayPrioritySound(kBuzzerSound, kBuzzerPriority);
|
||||
RestoreFromSavedMap(thisRoomNumber,
|
||||
masterObjects[whoLinked].objectNum, false);
|
||||
masterObjects[whoLinked].objectNum, kDefaultComponent, false);
|
||||
AddFlyingPoint(&bounds, 300, thisGlider->hVel / 2, thisGlider->vVel / 2);
|
||||
thisGlider->hVel /= 4;
|
||||
thisGlider->vVel /= 4;
|
||||
@@ -801,7 +801,7 @@ void HandleRewards (gliderPtr thisGlider, hotPtr who)
|
||||
{
|
||||
PlayPrioritySound(kDingSound, kDingPriority);
|
||||
RestoreFromSavedMap(thisRoomNumber,
|
||||
masterObjects[whoLinked].objectNum, false);
|
||||
masterObjects[whoLinked].objectNum, kDefaultComponent, false);
|
||||
AddFlyingPoint(&bounds, 500, thisGlider->hVel / 2, thisGlider->vVel / 2);
|
||||
thisGlider->hVel /= 4;
|
||||
thisGlider->vVel /= 4;
|
||||
@@ -817,7 +817,7 @@ void HandleRewards (gliderPtr thisGlider, hotPtr who)
|
||||
{
|
||||
PlayPrioritySound(kCuckooSound, kCuckooPriority);
|
||||
RestoreFromSavedMap(thisRoomNumber,
|
||||
masterObjects[whoLinked].objectNum, false);
|
||||
masterObjects[whoLinked].objectNum, kDefaultComponent, false);
|
||||
StopPendulum(thisRoomNumber, masterObjects[whoLinked].objectNum);
|
||||
AddFlyingPoint(&bounds, 1000, thisGlider->hVel / 2, thisGlider->vVel / 2);
|
||||
thisGlider->hVel /= 4;
|
||||
@@ -834,7 +834,7 @@ void HandleRewards (gliderPtr thisGlider, hotPtr who)
|
||||
{
|
||||
PlayPrioritySound(kEnergizeSound, kEnergizePriority);
|
||||
RestoreFromSavedMap(thisRoomNumber,
|
||||
masterObjects[whoLinked].objectNum, false);
|
||||
masterObjects[whoLinked].objectNum, kDefaultComponent, false);
|
||||
AddSparkle(&bounds);
|
||||
thisGlider->hVel /= 2;
|
||||
thisGlider->vVel /= 2;
|
||||
@@ -853,7 +853,7 @@ void HandleRewards (gliderPtr thisGlider, hotPtr who)
|
||||
{
|
||||
PlayPrioritySound(kEnergizeSound, kEnergizePriority);
|
||||
RestoreFromSavedMap(thisRoomNumber,
|
||||
masterObjects[whoLinked].objectNum, false);
|
||||
masterObjects[whoLinked].objectNum, kDefaultComponent, false);
|
||||
AddSparkle(&bounds);
|
||||
thisGlider->hVel /= 2;
|
||||
thisGlider->vVel /= 2;
|
||||
@@ -875,7 +875,7 @@ void HandleRewards (gliderPtr thisGlider, hotPtr who)
|
||||
{
|
||||
PlayPrioritySound(kEnergizeSound, kEnergizePriority);
|
||||
RestoreFromSavedMap(thisRoomNumber,
|
||||
masterObjects[whoLinked].objectNum, false);
|
||||
masterObjects[whoLinked].objectNum, kDefaultComponent, false);
|
||||
AddSparkle(&bounds);
|
||||
thisGlider->hVel /= 2;
|
||||
thisGlider->vVel /= 2;
|
||||
@@ -903,7 +903,7 @@ void HandleRewards (gliderPtr thisGlider, hotPtr who)
|
||||
{
|
||||
PlayPrioritySound(kEnergizeSound, kEnergizePriority);
|
||||
RestoreFromSavedMap(thisRoomNumber,
|
||||
masterObjects[whoLinked].objectNum, false);
|
||||
masterObjects[whoLinked].objectNum, kDefaultComponent, false);
|
||||
AddSparkle(&bounds);
|
||||
thisGlider->hVel /= 2;
|
||||
thisGlider->vVel /= 2;
|
||||
@@ -936,7 +936,7 @@ void HandleRewards (gliderPtr thisGlider, hotPtr who)
|
||||
{
|
||||
PlayPrioritySound(kEnergizeSound, kEnergizePriority);
|
||||
RestoreFromSavedMap(thisRoomNumber,
|
||||
masterObjects[whoLinked].objectNum, false);
|
||||
masterObjects[whoLinked].objectNum, kDefaultComponent, false);
|
||||
AddSparkle(&bounds);
|
||||
StopStar(thisRoomNumber, masterObjects[whoLinked].objectNum);
|
||||
numStarsRemaining--;
|
||||
@@ -959,7 +959,7 @@ void HandleRewards (gliderPtr thisGlider, hotPtr who)
|
||||
{
|
||||
PlayPrioritySound(kEnergizeSound, kEnergizePriority);
|
||||
RestoreFromSavedMap(thisRoomNumber,
|
||||
masterObjects[whoLinked].objectNum, false);
|
||||
masterObjects[whoLinked].objectNum, kDefaultComponent, false);
|
||||
AddSparkle(&bounds);
|
||||
thisGlider->hVel /= 2;
|
||||
thisGlider->vVel /= 2;
|
||||
@@ -1050,12 +1050,12 @@ void HandleSwitches (hotPtr who)
|
||||
case kFoil:
|
||||
case kStar:
|
||||
case kHelium:
|
||||
RestoreFromSavedMap(roomLinked, objectLinked, true);
|
||||
RestoreFromSavedMap(roomLinked, objectLinked, kDefaultComponent, true);
|
||||
AddSparkle(&bounds);
|
||||
break;
|
||||
|
||||
case kCuckoo:
|
||||
RestoreFromSavedMap(roomLinked, objectLinked, true);
|
||||
RestoreFromSavedMap(roomLinked, objectLinked, kDefaultComponent, true);
|
||||
StopPendulum(roomLinked, objectLinked);
|
||||
break;
|
||||
|
||||
|
||||
@@ -10,9 +10,11 @@
|
||||
#include "Environ.h"
|
||||
#include "HostDisplayDriver.h"
|
||||
#include "IGpDisplayDriver.h"
|
||||
#include "GpApplicationName.h"
|
||||
#include "Map.h"
|
||||
#include "MenuManager.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "RectUtils.h"
|
||||
#include "Tools.h"
|
||||
|
||||
@@ -46,11 +48,12 @@ extern Boolean twoPlayerGame, paused, hasMirror, splashDrawn;
|
||||
// The menus are loaded from disk and the menu bar set up and drawn.
|
||||
|
||||
void InitializeMenus (void)
|
||||
{
|
||||
{
|
||||
appleMenu = GetMenu(kAppleMenuID);
|
||||
if (appleMenu == nil)
|
||||
RedAlert(kErrFailedResourceLoad);
|
||||
//AppendResMenu(appleMenu, 'DRVR'); // GP: We don't support this
|
||||
AppendMenuItem(appleMenu, 0, 0, 0, 0, true, false, PSTR("About " GP_APPLICATION_NAME "\xc9"));
|
||||
InsertMenu(appleMenu, 0);
|
||||
|
||||
gameMenu = GetMenu(kGameMenuID);
|
||||
|
||||
@@ -244,12 +244,13 @@ void OpenLinkWindow (void)
|
||||
basicState.m_text.Set(4, "Link");
|
||||
basicState.m_window = linkWindow;
|
||||
|
||||
linkControl = PortabilityLayer::ButtonWidget::Create(basicState);
|
||||
PortabilityLayer::ButtonWidget::AdditionalData addlData;
|
||||
linkControl = PortabilityLayer::ButtonWidget::Create(basicState, &addlData);
|
||||
|
||||
basicState.m_rect = Rect::Create(5, 5, 25, 59);
|
||||
basicState.m_text.Set(6, "Unlink");
|
||||
basicState.m_window = linkWindow;
|
||||
unlinkControl = PortabilityLayer::ButtonWidget::Create(basicState);
|
||||
unlinkControl = PortabilityLayer::ButtonWidget::Create(basicState, &addlData);
|
||||
|
||||
linkWindow->DrawControls();
|
||||
|
||||
@@ -379,7 +380,7 @@ void HandleLinkClick (Point wherePt)
|
||||
return;
|
||||
|
||||
SetPortWindowPort(linkWindow);
|
||||
wherePt -= linkWindow->TopLeftCoord();
|
||||
wherePt -= linkWindow->GetTopLeftCoord();
|
||||
|
||||
part = FindControl(wherePt, linkWindow, &theControl);
|
||||
if ((theControl != nil) && (part != 0))
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "Environ.h"
|
||||
#include "IOStream.h"
|
||||
#include "House.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
|
||||
#define kPrefsVersion 0x0035
|
||||
@@ -352,6 +353,10 @@ int gpAppMain()
|
||||
InitSrcRects();
|
||||
CreateOffscreens(); SpinCursor(2);
|
||||
OpenMainWindow();
|
||||
|
||||
if (isDoColorFade)
|
||||
PortabilityLayer::WindowManager::GetInstance()->SetWindowDesaturation(mainWindow, 1.0);
|
||||
|
||||
InitSound(); SpinCursor(2);
|
||||
InitMusic(); SpinCursor(2);
|
||||
BuildHouseList();
|
||||
@@ -366,17 +371,8 @@ int gpAppMain()
|
||||
// HideMenuBarOld();
|
||||
#endif
|
||||
|
||||
// if ((isDoColorFade) && (thisMac.isDepth == 8))
|
||||
// {
|
||||
// wasSeed = ExtractCTSeed((CGrafPtr)mainWindow);
|
||||
// WashColorIn();
|
||||
// ForceCTSeed((CGrafPtr)mainWindow, wasSeed);
|
||||
// }
|
||||
// if ((!thisMac.hasSM3) && (numSMWarnings < 3))
|
||||
// {
|
||||
// numSMWarnings++;
|
||||
// BitchAboutSM3();
|
||||
// }
|
||||
if (isDoColorFade)
|
||||
WashColorIn();
|
||||
|
||||
UpdateMainWindow();
|
||||
|
||||
@@ -400,7 +396,7 @@ int gpAppMain()
|
||||
}
|
||||
WriteOutPrefs();
|
||||
RestoreColorDepth();
|
||||
PL_DEAD(FlushEvents(everyEvent, 0));
|
||||
PL_DEAD(FlushEvents());
|
||||
// theErr = LoadScrap();
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
|
||||
#include "PLNumberFormatting.h"
|
||||
#include "PLToolUtils.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "Externs.h"
|
||||
#include "Environ.h"
|
||||
@@ -20,6 +19,7 @@
|
||||
#include "RectUtils.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "WindowDef.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
@@ -69,20 +69,20 @@ void DrawOnSplash(DrawSurface *surface)
|
||||
if ((thisMac.hasQT) && (hasMovie))
|
||||
PasStringConcat(houseLoadedStr, PSTR(" (TV)"));
|
||||
|
||||
surface->SetApplicationFont(9, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(9, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
const Point textPoint = Point::Create(splashOriginH + 436, splashOriginV + 314);
|
||||
if (thisMac.isDepth == 4)
|
||||
{
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(255, 255, 255, 255));
|
||||
surface->DrawString(textPoint, houseLoadedStr, true);
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
surface->DrawString(textPoint, houseLoadedStr, whiteColor, appFont);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (houseIsReadOnly)
|
||||
ColorText(surface, textPoint, houseLoadedStr, 5L);
|
||||
ColorText(surface, textPoint, houseLoadedStr, 5L, appFont);
|
||||
else
|
||||
ColorText(surface, textPoint, houseLoadedStr, 28L);
|
||||
ColorText(surface, textPoint, houseLoadedStr, 28L, appFont);
|
||||
}
|
||||
|
||||
#if defined(powerc) || defined(__powerc)
|
||||
@@ -106,8 +106,8 @@ void RedrawSplashScreen (void)
|
||||
Rect tempRect;
|
||||
DrawSurface *surface = workSrcMap;
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->FillRect(workSrcRect);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
surface->FillRect(workSrcRect, blackColor);
|
||||
|
||||
QSetRect(&tempRect, 0, 0, 640, 460);
|
||||
QOffsetRect(&tempRect, splashOriginH, splashOriginV);
|
||||
@@ -117,7 +117,7 @@ void RedrawSplashScreen (void)
|
||||
SetPortWindowPort(mainWindow);
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
|
||||
&workSrcRect, &workSrcRect, srcCopy);
|
||||
|
||||
// if (quickerTransitions)
|
||||
@@ -126,7 +126,7 @@ void RedrawSplashScreen (void)
|
||||
// DissBits(&workSrcRect);
|
||||
CopyRectMainToWork(&workSrcRect);
|
||||
|
||||
mainWindow->m_surface.m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||
mainWindow->GetDrawSurface()->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||
PortabilityLayer::MenuManager::GetInstance()->SetMenuVisible(true);
|
||||
}
|
||||
|
||||
@@ -144,25 +144,27 @@ void UpdateMainWindow (void)
|
||||
{
|
||||
PauseMarquee();
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
|
||||
&mainWindowRect, &mainWindowRect, srcCopy);
|
||||
ResumeMarquee();
|
||||
}
|
||||
else if ((theMode == kSplashMode) || (theMode == kPlayMode))
|
||||
{
|
||||
workSrcMap->FillRect(workSrcRect);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
workSrcMap->FillRect(workSrcRect, blackColor);
|
||||
|
||||
QSetRect(&tempRect, 0, 0, 640, 460);
|
||||
QOffsetRect(&tempRect, splashOriginH, splashOriginV);
|
||||
LoadScaledGraphic(workSrcMap, kSplash8BitPICT, &tempRect);
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
|
||||
&workSrcRect, &mainWindowRect, srcCopy);
|
||||
SetPortWindowPort(mainWindow);
|
||||
|
||||
DrawOnSplash(mainWindow->GetDrawSurface());
|
||||
}
|
||||
|
||||
mainWindow->m_surface.m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||
mainWindow->GetDrawSurface()->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||
|
||||
splashDrawn = true;
|
||||
}
|
||||
@@ -174,7 +176,9 @@ void OpenMainWindow (void)
|
||||
{
|
||||
// long wasSeed;
|
||||
short whichRoom;
|
||||
|
||||
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
|
||||
if (mainWindow != nil)
|
||||
{
|
||||
YellowAlert(kYellowUnaccounted, 6);
|
||||
@@ -199,10 +203,6 @@ void OpenMainWindow (void)
|
||||
ShowWindow(mainWindow);
|
||||
|
||||
DrawSurface *mainWindowSurface = mainWindow->GetDrawSurface();
|
||||
|
||||
mainWindowSurface->SetClipRect(mainWindowRect);
|
||||
mainWindowSurface->SetForeColor(StdColors::Black());
|
||||
mainWindowSurface->SetBackColor(StdColors::White());
|
||||
|
||||
whichRoom = GetFirstRoomNumber();
|
||||
CopyRoomToThisRoom(whichRoom);
|
||||
@@ -249,11 +249,9 @@ void OpenMainWindow (void)
|
||||
|
||||
DrawSurface *mainWindowSurface = mainWindow->GetDrawSurface();
|
||||
|
||||
mainWindowSurface->SetClipRect(mainWindowRect);
|
||||
// CopyRgn(mainWindow->clipRgn, mainWindow->visRgn);
|
||||
mainWindowSurface->SetForeColor(StdColors::Black());
|
||||
mainWindowSurface->SetBackColor(StdColors::White());
|
||||
mainWindowSurface->FillRect(mainWindowRect);
|
||||
|
||||
mainWindowSurface->FillRect(mainWindowRect, blackColor);
|
||||
|
||||
splashOriginH = ((thisMac.constrainedScreen.right - thisMac.constrainedScreen.left) - 640) / 2;
|
||||
if (splashOriginH < 0)
|
||||
@@ -262,7 +260,7 @@ void OpenMainWindow (void)
|
||||
if (splashOriginV < 0)
|
||||
splashOriginV = 0;
|
||||
|
||||
workSrcMap->FillRect(workSrcRect);
|
||||
workSrcMap->FillRect(workSrcRect, blackColor);
|
||||
|
||||
// if ((fadeGraysOut) && (isDoColorFade))
|
||||
// {
|
||||
@@ -279,10 +277,10 @@ void OpenMainWindow (void)
|
||||
}
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
|
||||
&mainWindowRect, &mainWindowRect, srcCopy);
|
||||
|
||||
mainWindow->m_surface.m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||
mainWindow->GetDrawSurface()->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- CloseMainWindow
|
||||
@@ -373,7 +371,7 @@ void HandleMainClick (Point wherePt, Boolean isDoubleClick)
|
||||
return;
|
||||
|
||||
SetPortWindowPort(mainWindow);
|
||||
wherePt -= mainWindow->TopLeftCoord();
|
||||
wherePt -= mainWindow->GetTopLeftCoord();
|
||||
|
||||
DrawSurface *mainWindowSurface = mainWindow->GetDrawSurface();
|
||||
|
||||
@@ -580,54 +578,20 @@ void HardDrawMainWindow (void)
|
||||
//-------------------------------------------------------------- WashColorIn
|
||||
// Slowly walks the palette from its gray luminance state to the full colorÉ
|
||||
// palette. In this way, color appears to slowly wash in.
|
||||
/*
|
||||
void WashColorIn (void)
|
||||
{
|
||||
#define kGray2ColorSteps 180
|
||||
GDHandle theDevice;
|
||||
long longDelta;
|
||||
short i, c;
|
||||
|
||||
theDevice = GetGDevice();
|
||||
SetGDevice(thisGDevice);
|
||||
|
||||
|
||||
for (i = 0; i < kGray2ColorSteps; i++)
|
||||
{
|
||||
for (c = 0; c < 256; c++)
|
||||
{
|
||||
if (c != 5)
|
||||
{
|
||||
longDelta = (((long)wasColors[c].rgb.red -
|
||||
(long)newColors[c].rgb.red) /
|
||||
(long)(kGray2ColorSteps - i)) + (long)newColors[c].rgb.red;
|
||||
newColors[c].rgb.red = (unsigned short)longDelta;
|
||||
|
||||
longDelta = (((long)wasColors[c].rgb.green -
|
||||
(long)newColors[c].rgb.green) /
|
||||
(long)(kGray2ColorSteps - i)) +
|
||||
(long)newColors[c].rgb.green;
|
||||
newColors[c].rgb.green = (unsigned short)longDelta;
|
||||
|
||||
longDelta = (((long)wasColors[c].rgb.blue -
|
||||
(long)newColors[c].rgb.blue) /
|
||||
(long)(kGray2ColorSteps - i)) +
|
||||
(long)newColors[c].rgb.blue;
|
||||
newColors[c].rgb.blue = (unsigned short)longDelta;
|
||||
}
|
||||
}
|
||||
SetEntries(0, 255, newColors);
|
||||
if (Button())
|
||||
PortabilityLayer::WindowManager::GetInstance()->SetWindowDesaturation(mainWindow, static_cast<float>(kGray2ColorSteps - i) / static_cast<float>(kGray2ColorSteps));
|
||||
|
||||
Delay(1, nullptr);
|
||||
if (PortabilityLayer::InputManager::GetInstance()->GetKeys()->m_mouse.Get(GpMouseButtons::kLeft))
|
||||
break;
|
||||
}
|
||||
|
||||
SetEntries(0, 255, wasColors);
|
||||
SetGDevice(theDevice);
|
||||
|
||||
RestoreColorsSlam();
|
||||
|
||||
if (wasColors != nil)
|
||||
DisposePtr((Ptr)wasColors);
|
||||
if (newColors != nil)
|
||||
DisposePtr((Ptr)newColors);
|
||||
|
||||
PortabilityLayer::WindowManager::GetInstance()->SetWindowDesaturation(mainWindow, 0.0f);
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "WindowManager.h"
|
||||
#include "QDPixMap.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "Utilities.h"
|
||||
|
||||
|
||||
@@ -35,8 +36,8 @@
|
||||
|
||||
void LoadGraphicPlus (DrawSurface *, short, const Rect &);
|
||||
void RedrawMapContents (void);
|
||||
void LiveHScrollAction (ControlHandle, short);
|
||||
void LiveVScrollAction (ControlHandle, short);
|
||||
void LiveHScrollAction (PortabilityLayer::Widget *theControl, int thePart);
|
||||
void LiveVScrollAction (PortabilityLayer::Widget *theControl, int thePart);
|
||||
Boolean QueryNewRoom (void);
|
||||
void CreateNailOffscreen (void);
|
||||
void KillNailOffscreen (void);
|
||||
@@ -205,9 +206,6 @@ void RedrawMapContents (void)
|
||||
newClip.bottom = mapWindowRect.bottom + 2 - kMapScrollBarWidth;
|
||||
|
||||
DrawSurface *surface = mapWindow->GetDrawSurface();
|
||||
|
||||
const Rect wasClip = surface->GetClipRect();
|
||||
surface->SetClipRect(newClip);
|
||||
|
||||
for (i = 0; i < mapRoomsHigh; i++)
|
||||
{
|
||||
@@ -227,7 +225,6 @@ void RedrawMapContents (void)
|
||||
type = kNumBackgrounds; // Draw "?" thumbnail.
|
||||
}
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
if (type > kNumBackgrounds) // Do a "pretty" thumbnail.
|
||||
{
|
||||
LoadGraphicPlus(surface, type + kBaseBackgroundID, aRoom);
|
||||
@@ -237,7 +234,7 @@ void RedrawMapContents (void)
|
||||
QSetRect(&src, 0, 0, kMapRoomWidth, kMapRoomHeight);
|
||||
QOffsetRect(&src, 0, type * kMapRoomHeight);
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(nailSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mapWindow)),
|
||||
GetPortBitMapForCopyBits(mapWindow->GetDrawSurface()),
|
||||
&src, &aRoom, srcCopy);
|
||||
}
|
||||
|
||||
@@ -249,52 +246,74 @@ void RedrawMapContents (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(aRoom);
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
surface->FillRect(aRoom, whiteColor);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor overlayColor;
|
||||
if (i >= groundLevel)
|
||||
surface->SetForeColor(StdColors::Green());
|
||||
overlayColor = StdColors::Green();
|
||||
else
|
||||
surface->SetForeColor(StdColors::Blue());
|
||||
overlayColor = StdColors::Blue();
|
||||
|
||||
Pattern dummyPat;
|
||||
surface->FillRectWithPattern8x8(aRoom, true, *GetQDGlobalsGray(&dummyPat));
|
||||
surface->FillRectWithMaskPattern8x8(aRoom, *GetQDGlobalsGray(&dummyPat), overlayColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
|
||||
for (i = 1; i < mapRoomsWide; i++)
|
||||
{
|
||||
const Point upperPoint = Point::Create(i * kMapRoomWidth, 0);
|
||||
const Point lowerPoint = Point::Create(upperPoint.h, upperPoint.v + mapRoomsHigh * kMapRoomHeight);
|
||||
surface->DrawLine(upperPoint, lowerPoint);
|
||||
surface->DrawLine(upperPoint, lowerPoint, blackColor);
|
||||
}
|
||||
|
||||
for (i = 1; i < mapRoomsHigh; i++)
|
||||
{
|
||||
const Point leftPoint = Point::Create(0, i * kMapRoomHeight);
|
||||
const Point rightPoint = leftPoint + Point::Create(mapRoomsWide * kMapRoomWidth, 0);
|
||||
surface->DrawLine(leftPoint, rightPoint);
|
||||
surface->DrawLine(leftPoint, rightPoint, blackColor);
|
||||
}
|
||||
|
||||
if (activeRoomVisible)
|
||||
{
|
||||
surface->SetForeColor(StdColors::Red());
|
||||
PortabilityLayer::ResolveCachingColor redColor = StdColors::Red();
|
||||
|
||||
activeRoomRect.right++;
|
||||
activeRoomRect.bottom++;
|
||||
surface->FrameRect(activeRoomRect);
|
||||
surface->FrameRect(activeRoomRect, redColor);
|
||||
InsetRect(&activeRoomRect, 1, 1);
|
||||
surface->FrameRect(activeRoomRect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->FrameRect(activeRoomRect, redColor);
|
||||
InsetRect(&activeRoomRect, -1, -1);
|
||||
}
|
||||
|
||||
surface->SetClipRect(wasClip);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//-------------------------------------------------------------- UpdateMapWindow
|
||||
void DrawMapResizeBox(void)
|
||||
{
|
||||
DrawSurface *surface = mapWindow->GetDrawSurface();
|
||||
|
||||
const Rect windowRect = surface->m_port.GetRect();
|
||||
Rect growBoxRect = Rect::Create(windowRect.bottom - 14, windowRect.right - 14, windowRect.bottom, windowRect.right);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor backgroundColor = PortabilityLayer::RGBAColor::Create(204, 204, 204, 255);
|
||||
surface->FillRect(growBoxRect, backgroundColor);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
surface->FillRect(Rect::Create(growBoxRect.top + 2, growBoxRect.left + 2, growBoxRect.top + 3, growBoxRect.left + 6), blackColor);
|
||||
surface->FillRect(Rect::Create(growBoxRect.top + 3, growBoxRect.left + 2, growBoxRect.top + 6, growBoxRect.left + 3), blackColor);
|
||||
|
||||
surface->FillRect(Rect::Create(growBoxRect.top + 8, growBoxRect.left + 11, growBoxRect.top + 12, growBoxRect.left + 12), blackColor);
|
||||
surface->FillRect(Rect::Create(growBoxRect.top + 11, growBoxRect.left + 8, growBoxRect.top + 12, growBoxRect.left + 11), blackColor);
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
surface->FillRect(Rect::Create(growBoxRect.top + 3 + i, growBoxRect.left + 3 + i, growBoxRect.top + 5 + i, growBoxRect.left + 5 + i), blackColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- UpdateMapWindow
|
||||
|
||||
void UpdateMapWindow (void)
|
||||
@@ -311,6 +330,8 @@ void UpdateMapWindow (void)
|
||||
SetPortWindowPort(mapWindow);
|
||||
// PL_NotYetImplemented_TODO("Resize")
|
||||
RedrawMapContents();
|
||||
|
||||
DrawMapResizeBox();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -334,17 +355,17 @@ void ResizeMapWindow (short newH, short newV)
|
||||
mapRoomsWide * kMapRoomWidth + kMapScrollBarWidth - 1,
|
||||
mapRoomsHigh * kMapRoomHeight + kMapScrollBarWidth - 1);
|
||||
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(mapWindowRect);
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
surface->FillRect(mapWindowRect, whiteColor);
|
||||
SizeWindow(mapWindow, mapWindowRect.right, mapWindowRect.bottom, true);
|
||||
|
||||
mapHScroll->SetMax(kMaxNumRoomsH - mapRoomsWide);
|
||||
mapHScroll->SetPosition(Point::Create(0, mapWindowRect.bottom - kMapScrollBarWidth + 1));
|
||||
mapHScroll->SetPosition(Point::Create(-1, 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 + 1, 0));
|
||||
mapVScroll->SetPosition(Point::Create(mapWindowRect.right - kMapScrollBarWidth + 1, -1));
|
||||
mapVScroll->Resize(kMapScrollBarWidth, mapWindowRect.bottom - kMapScrollBarWidth + 3);
|
||||
mapTopRoom = mapVScroll->GetState();
|
||||
|
||||
@@ -366,7 +387,7 @@ void OpenMapWindow (void)
|
||||
mapRoomsWide * kMapRoomWidth + kMapScrollBarWidth - 1,
|
||||
mapRoomsHigh * kMapRoomHeight + kMapScrollBarWidth - 1);
|
||||
|
||||
const uint16_t windowStyle = PortabilityLayer::WindowStyleFlags::kTitleBar | PortabilityLayer::WindowStyleFlags::kResizable | PortabilityLayer::WindowStyleFlags::kMiniBar | PortabilityLayer::WindowStyleFlags::kCloseBox;;
|
||||
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, 0, 0, PSTR("Map"));
|
||||
|
||||
@@ -390,7 +411,7 @@ void OpenMapWindow (void)
|
||||
PortabilityLayer::WindowManager::GetInstance()->ShowWindow(mapWindow);
|
||||
// FlagWindowFloating(mapWindow); TEMP - use flaoting windows
|
||||
|
||||
SetPort(&mapWindow->GetDrawSurface()->m_port);
|
||||
SetPort(mapWindow->GetDrawSurface());
|
||||
QSetRect(&mapHScrollRect, -1, mapRoomsHigh * kMapRoomHeight,
|
||||
mapRoomsWide * kMapRoomWidth + 1,
|
||||
mapRoomsHigh * kMapRoomHeight + kMapScrollBarWidth);
|
||||
@@ -405,7 +426,7 @@ void OpenMapWindow (void)
|
||||
state.m_window = mapWindow;
|
||||
state.m_max = kMaxNumRoomsH - mapRoomsWide;
|
||||
state.m_state = mapLeftRoom;
|
||||
mapHScroll = PortabilityLayer::ScrollBarWidget::Create(state);
|
||||
mapHScroll = PortabilityLayer::ScrollBarWidget::Create(state, nullptr);
|
||||
}
|
||||
|
||||
if (mapHScroll == nil)
|
||||
@@ -418,7 +439,7 @@ void OpenMapWindow (void)
|
||||
state.m_window = mapWindow;
|
||||
state.m_max = kMaxNumRoomsV - mapRoomsHigh;
|
||||
state.m_state = mapTopRoom;
|
||||
mapVScroll = PortabilityLayer::ScrollBarWidget::Create(state);
|
||||
mapVScroll = PortabilityLayer::ScrollBarWidget::Create(state, nullptr);
|
||||
}
|
||||
|
||||
if (mapVScroll == nil)
|
||||
@@ -600,7 +621,7 @@ void HandleMapClick (const GpMouseInputEvent &theEvent)
|
||||
|
||||
SetPortWindowPort(mapWindow);
|
||||
globalWhere = wherePt;
|
||||
wherePt -= mapWindow->TopLeftCoord();
|
||||
wherePt -= mapWindow->GetTopLeftCoord();
|
||||
wherePt.h -= 1;
|
||||
wherePt.v -= 1;
|
||||
|
||||
|
||||
@@ -432,7 +432,7 @@ Boolean PtInMarqueeHandle (Point where)
|
||||
|
||||
void DrawGliderMarquee (void)
|
||||
{
|
||||
DrawSurface *surface = GetWindowPort(mainWindow);
|
||||
DrawSurface *surface = mainWindow->GetDrawSurface();
|
||||
ImageInvert(*GetGWorldPixMap(blowerMaskMap), GetPortBitMapForCopyBits(surface), leftStartGliderSrc, marqueeGliderRect);
|
||||
surface->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "PLHacks.h"
|
||||
#include "PLMenus.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "PLToolUtils.h"
|
||||
#include "DialogManager.h"
|
||||
#include "DialogUtils.h"
|
||||
#include "Externs.h"
|
||||
@@ -294,6 +293,10 @@ void DoAppleMenu (short theItem)
|
||||
DoAbout();
|
||||
break;
|
||||
|
||||
case iAboutAerofoil:
|
||||
DoAboutFramework();
|
||||
break;
|
||||
|
||||
default:
|
||||
// GetMenuItemText(appleMenu, theItem, daName);
|
||||
// GetPort(&wasPort);
|
||||
|
||||
@@ -134,7 +134,7 @@ void ToggleMusicWhilePlaying (void)
|
||||
|
||||
void SetMusicalMode (short newMode)
|
||||
{
|
||||
if (dontLoadMusic)
|
||||
if (dontLoadMusic || failedMusic)
|
||||
return;
|
||||
|
||||
musicMutex->Lock();
|
||||
@@ -302,6 +302,12 @@ void InitMusic (void)
|
||||
return;
|
||||
}
|
||||
theErr = OpenMusicChannel();
|
||||
if (theErr != PLErrors::kNone)
|
||||
{
|
||||
YellowAlert(kYellowNoMusic, theErr);
|
||||
failedMusic = true;
|
||||
return;
|
||||
}
|
||||
|
||||
musicScore[0] = 0;
|
||||
musicScore[1] = 1;
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
//============================================================================
|
||||
|
||||
|
||||
#include "PLToolUtils.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "DialogManager.h"
|
||||
#include "Externs.h"
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "Room.h"
|
||||
#include "Vec2i.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "ScanlineMask.h"
|
||||
#include "ScanlineMaskConverter.h"
|
||||
|
||||
@@ -164,9 +165,9 @@ void DrawTable (Rect *tableTop, short down)
|
||||
GetQDGlobalsGray(&dummyPattern);
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, 15, true, dummyPattern);
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, 15, dummyPattern);
|
||||
else
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, k8DkstGrayColor, true, dummyPattern);
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, k8DkstGrayColor, dummyPattern);
|
||||
|
||||
InsetRect(tableTop, 0, 1);
|
||||
ColorRect(backSrcMap, *tableTop, brownC);
|
||||
@@ -279,9 +280,9 @@ void DrawShelf (Rect *shelfTop)
|
||||
{
|
||||
GetQDGlobalsGray(&dummyPattern);
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, dummyPattern);
|
||||
else
|
||||
ColorRegionMaskPattern(backSrcMap, mask, k8DkstGrayColor, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, k8DkstGrayColor, dummyPattern);
|
||||
mask->Destroy();
|
||||
}
|
||||
|
||||
@@ -367,9 +368,9 @@ void DrawCabinet (Rect *cabinet)
|
||||
{
|
||||
GetQDGlobalsGray(&dummyPattern);
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, dummyPattern);
|
||||
else
|
||||
ColorRegionMaskPattern(backSrcMap, mask, dkGrayC, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, dkGrayC, dummyPattern);
|
||||
|
||||
mask->Destroy();
|
||||
}
|
||||
@@ -445,7 +446,8 @@ void DrawCabinet (Rect *cabinet)
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
&handleSrc, &handleSrc, &tempRect);
|
||||
|
||||
backSrcMap->FrameRect(*cabinet);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
backSrcMap->FrameRect(*cabinet, blackColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawSimpleFurniture
|
||||
@@ -504,9 +506,9 @@ void DrawCounter(Rect *counter)
|
||||
{
|
||||
GetQDGlobalsGray(&dummyPattern);
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, dummyPattern);
|
||||
else
|
||||
ColorRegionMaskPattern(backSrcMap, mask, dkGrayC, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, dkGrayC, dummyPattern);
|
||||
|
||||
mask->Destroy();
|
||||
}
|
||||
@@ -747,7 +749,7 @@ void DrawDeckTable (Rect *tableTop, short down)
|
||||
-HalfRectTall(&tempRect) + kTableShadowTop + down);
|
||||
QOffsetRect(&tempRect, kTableShadowOffset, -kTableShadowOffset);
|
||||
GetQDGlobalsGray(&dummyPattern);
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, dkGrayC, true, dummyPattern);
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, dkGrayC, dummyPattern);
|
||||
|
||||
InsetRect(tableTop, 0, 1);
|
||||
ColorRect(backSrcMap, *tableTop, kGoldColor);
|
||||
@@ -982,7 +984,7 @@ void DrawClockHands (Point where, short bigHand, short littleHand)
|
||||
{
|
||||
DrawSurface *surface = backSrcMap;
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
const Point midPoint = Point::Create(where.h, where.v);
|
||||
Point otherPoint = midPoint;
|
||||
|
||||
@@ -1037,7 +1039,7 @@ void DrawClockHands (Point where, short bigHand, short littleHand)
|
||||
break;
|
||||
}
|
||||
|
||||
surface->DrawLine(midPoint, otherPoint);
|
||||
surface->DrawLine(midPoint, otherPoint, blackColor);
|
||||
|
||||
switch (littleHand)
|
||||
{
|
||||
@@ -1090,7 +1092,7 @@ void DrawClockHands (Point where, short bigHand, short littleHand)
|
||||
break;
|
||||
}
|
||||
|
||||
surface->DrawLine(midPoint, otherPoint);
|
||||
surface->DrawLine(midPoint, otherPoint, blackColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawClockHands
|
||||
@@ -1099,7 +1101,7 @@ void DrawLargeClockHands (Point where, short bigHand, short littleHand)
|
||||
{
|
||||
DrawSurface *surface = backSrcMap;
|
||||
|
||||
surface->SetForeColor(StdColors::White());
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
|
||||
const Point midPoint = Point::Create(where.h, where.v);
|
||||
Point otherPoint = midPoint;
|
||||
@@ -1155,7 +1157,7 @@ void DrawLargeClockHands (Point where, short bigHand, short littleHand)
|
||||
break;
|
||||
}
|
||||
|
||||
surface->DrawLine(midPoint, otherPoint);
|
||||
surface->DrawLine(midPoint, otherPoint, whiteColor);
|
||||
|
||||
switch (littleHand)
|
||||
{
|
||||
@@ -1208,8 +1210,7 @@ void DrawLargeClockHands (Point where, short bigHand, short littleHand)
|
||||
break;
|
||||
}
|
||||
|
||||
surface->DrawLine(midPoint, otherPoint);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->DrawLine(midPoint, otherPoint, whiteColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawSimplePrizes
|
||||
@@ -1249,8 +1250,8 @@ void DrawGreaseRt (Rect *theRect, short distance, Boolean state, Boolean drawSpi
|
||||
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);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
backSrcMap->FillRect(spill, blackColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1280,11 +1281,11 @@ void DrawGreaseLf (Rect *theRect, short distance, Boolean state, Boolean drawSpi
|
||||
|
||||
if (drawSpill)
|
||||
{
|
||||
backSrcMap->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
|
||||
QSetRect(&spill, -distance + 5, -2, 0, 0);
|
||||
QOffsetRect(&spill, dest.left + 1, dest.bottom);
|
||||
backSrcMap->FillRect(spill);
|
||||
backSrcMap->FillRect(spill, blackColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1312,6 +1313,7 @@ void DrawInvisBonus (Rect *theRect)
|
||||
|
||||
void DrawSlider (Rect *theRect)
|
||||
{
|
||||
backSrcMap->FrameRect(*theRect);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
backSrcMap->FrameRect(*theRect, blackColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include "BitmapImage.h"
|
||||
#include "PLResources.h"
|
||||
#include "PLTextUtils.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "Externs.h"
|
||||
#include "FontFamily.h"
|
||||
@@ -15,6 +14,8 @@
|
||||
#include "Environ.h"
|
||||
#include "Objects.h"
|
||||
#include "RectUtils.h"
|
||||
#include "RenderedFont.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "Room.h"
|
||||
#include "Utilities.h"
|
||||
@@ -578,8 +579,7 @@ void DrawMacPlus (Rect *theRect, Boolean isOn, Boolean isLit)
|
||||
|
||||
if (IsMacPlusGraphicBanned())
|
||||
{
|
||||
const PortabilityLayer::RGBAColor beigeColor = PortabilityLayer::RGBAColor::Create(255, 255, 204, 255);
|
||||
const PortabilityLayer::RGBAColor wasColor = backSrcMap->GetForeColor();
|
||||
PortabilityLayer::ResolveCachingColor beigeColor = PortabilityLayer::RGBAColor::Create(255, 255, 204, 255);
|
||||
|
||||
Rect paintOverRect = *theRect;
|
||||
paintOverRect.left += 8;
|
||||
@@ -587,9 +587,7 @@ void DrawMacPlus (Rect *theRect, Boolean isOn, Boolean isLit)
|
||||
paintOverRect.right = paintOverRect.left + 17;
|
||||
paintOverRect.bottom = paintOverRect.top + 6;
|
||||
|
||||
backSrcMap->SetForeColor(beigeColor);
|
||||
backSrcMap->FillRect(paintOverRect);
|
||||
backSrcMap->SetForeColor(wasColor);
|
||||
backSrcMap->FillRect(paintOverRect, beigeColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1063,13 +1061,13 @@ void DrawCalendar (Rect *theRect)
|
||||
backSrcMap->DrawPicture(thePicture, bounds);
|
||||
thePicture.Dispose();
|
||||
|
||||
backSrcMap->SetApplicationFont(9, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(9, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
GetTime(&timeRec);
|
||||
GetIndString(monthStr, kMonthStringID, timeRec.month);
|
||||
|
||||
const Point textPos = Point::Create(theRect->left + ((64 - backSrcMap->MeasureString(monthStr)) / 2), theRect->top + 55);
|
||||
ColorText(backSrcMap, textPos, monthStr, kDarkFleshColor);
|
||||
const Point textPos = Point::Create(theRect->left + ((64 - appFont->MeasurePStr(monthStr)) / 2), theRect->top + 55);
|
||||
ColorText(backSrcMap, textPos, monthStr, kDarkFleshColor, appFont);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DrawBulletin
|
||||
|
||||
@@ -301,9 +301,9 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
|
||||
if (SectRect(&itsRect, &testRect, &whoCares))
|
||||
{
|
||||
if (redraw)
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
else
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
if (legit != -1)
|
||||
DrawRedClock(&itsRect);
|
||||
}
|
||||
@@ -315,9 +315,9 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
|
||||
if (SectRect(&itsRect, &testRect, &whoCares))
|
||||
{
|
||||
if (redraw)
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
else
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
if (legit != -1)
|
||||
DrawBlueClock(&itsRect);
|
||||
}
|
||||
@@ -329,9 +329,9 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
|
||||
if (SectRect(&itsRect, &testRect, &whoCares))
|
||||
{
|
||||
if (redraw)
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
else
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
if (legit != -1)
|
||||
DrawYellowClock(&itsRect);
|
||||
}
|
||||
@@ -343,9 +343,9 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
|
||||
if (SectRect(&itsRect, &testRect, &whoCares))
|
||||
{
|
||||
if (redraw)
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
else
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
if (legit != -1)
|
||||
{
|
||||
DrawCuckoo(&itsRect);
|
||||
@@ -369,9 +369,9 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
|
||||
if (SectRect(&itsRect, &testRect, &whoCares))
|
||||
{
|
||||
if (redraw)
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
else
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
if (legit != -1)
|
||||
DrawSimplePrizes(thisObject.what, &itsRect);
|
||||
}
|
||||
@@ -435,9 +435,9 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
|
||||
if (SectRect(&itsRect, &testRect, &whoCares))
|
||||
{
|
||||
if (redraw)
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
else
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
if (legit != -1)
|
||||
DrawFoil(&itsRect);
|
||||
}
|
||||
@@ -453,9 +453,9 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
|
||||
if (SectRect(&itsRect, &testRect, &whoCares))
|
||||
{
|
||||
if (redraw)
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = ReBackUpSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
else
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i);
|
||||
legit = BackUpToSavedMap(&itsRect, localNumbers[neighbor], i, kDefaultComponent);
|
||||
if (legit != -1)
|
||||
{
|
||||
if (redraw)
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLSound.h"
|
||||
#include "PLToolUtils.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "BitmapImage.h"
|
||||
#include "Externs.h"
|
||||
@@ -17,7 +16,9 @@
|
||||
#include "ObjectEdit.h"
|
||||
#include "Objects.h"
|
||||
#include "Play.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "Room.h"
|
||||
|
||||
@@ -812,10 +813,8 @@ void AddObjectPairing (void)
|
||||
|
||||
GetLocalizedString(45, message);
|
||||
OpenMessageWindow(message);
|
||||
ForeColor(blueColor);
|
||||
GetLocalizedString(46, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(60);
|
||||
CloseMessageWindow();
|
||||
}
|
||||
@@ -843,10 +842,8 @@ void AddObjectPairing (void)
|
||||
|
||||
GetLocalizedString(45, message);
|
||||
OpenMessageWindow(message);
|
||||
ForeColor(blueColor);
|
||||
GetLocalizedString(46, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(60);
|
||||
CloseMessageWindow();
|
||||
}
|
||||
@@ -874,10 +871,8 @@ void AddObjectPairing (void)
|
||||
|
||||
GetLocalizedString(45, message);
|
||||
OpenMessageWindow(message);
|
||||
ForeColor(blueColor);
|
||||
GetLocalizedString(47, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(60);
|
||||
CloseMessageWindow();
|
||||
}
|
||||
@@ -905,10 +900,8 @@ void AddObjectPairing (void)
|
||||
|
||||
GetLocalizedString(45, message);
|
||||
OpenMessageWindow(message);
|
||||
ForeColor(blueColor);
|
||||
GetLocalizedString(47, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(60);
|
||||
CloseMessageWindow();
|
||||
}
|
||||
@@ -936,10 +929,8 @@ void AddObjectPairing (void)
|
||||
|
||||
GetLocalizedString(45, message);
|
||||
OpenMessageWindow(message);
|
||||
ForeColor(blueColor);
|
||||
GetLocalizedString(48, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(60);
|
||||
CloseMessageWindow();
|
||||
}
|
||||
@@ -967,10 +958,8 @@ void AddObjectPairing (void)
|
||||
|
||||
GetLocalizedString(45, message);
|
||||
OpenMessageWindow(message);
|
||||
ForeColor(blueColor);
|
||||
GetLocalizedString(48, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(60);
|
||||
CloseMessageWindow();
|
||||
}
|
||||
@@ -998,10 +987,8 @@ void AddObjectPairing (void)
|
||||
|
||||
GetLocalizedString(45, message);
|
||||
OpenMessageWindow(message);
|
||||
ForeColor(blueColor);
|
||||
GetLocalizedString(49, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(60);
|
||||
CloseMessageWindow();
|
||||
}
|
||||
@@ -1029,10 +1016,8 @@ void AddObjectPairing (void)
|
||||
|
||||
GetLocalizedString(45, message);
|
||||
OpenMessageWindow(message);
|
||||
ForeColor(blueColor);
|
||||
GetLocalizedString(49, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(60);
|
||||
CloseMessageWindow();
|
||||
}
|
||||
@@ -1061,10 +1046,8 @@ void AddObjectPairing (void)
|
||||
|
||||
GetLocalizedString(45, message);
|
||||
OpenMessageWindow(message);
|
||||
ForeColor(blueColor);
|
||||
GetLocalizedString(50, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(60);
|
||||
CloseMessageWindow();
|
||||
}
|
||||
@@ -1093,10 +1076,8 @@ void AddObjectPairing (void)
|
||||
|
||||
GetLocalizedString(45, message);
|
||||
OpenMessageWindow(message);
|
||||
ForeColor(blueColor);
|
||||
GetLocalizedString(51, message);
|
||||
SetMessageWindowMessage(message);
|
||||
ForeColor(blackColor);
|
||||
SetMessageWindowMessage(message, StdColors::Blue());
|
||||
DelayTicks(60);
|
||||
CloseMessageWindow();
|
||||
}
|
||||
@@ -2270,7 +2251,8 @@ void DrawThisRoomsObjects (void)
|
||||
{
|
||||
if (GetNumberOfLights(thisRoomNumber) <= 0)
|
||||
{
|
||||
surface->FillRectWithPattern8x8(backSrcRect, true, *GetQDGlobalsGray(&dummyPattern));
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
surface->FillRectWithMaskPattern8x8(backSrcRect, *GetQDGlobalsGray(&dummyPattern), blackColor);
|
||||
}
|
||||
|
||||
for (i = 0; i < kMaxRoomObs; i++)
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLNumberFormatting.h"
|
||||
#include "PLSound.h"
|
||||
#include "PLTextUtils.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "DialogManager.h"
|
||||
#include "DialogUtils.h"
|
||||
@@ -18,6 +17,7 @@
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
#include "QDPixMap.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
|
||||
|
||||
#define kBlowerInfoDialogID 1007
|
||||
@@ -126,11 +126,12 @@ void UpdateBlowerInfo (Dialog *theDialog)
|
||||
{
|
||||
#define kArrowheadLength 4
|
||||
Rect bounds;
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
|
||||
Window *window = theDialog->GetWindow();
|
||||
DrawSurface *surface = window->GetDrawSurface();
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect((*surface->m_port.GetPixMap())->m_rect);
|
||||
|
||||
surface->FillRect((*surface->m_port.GetPixMap())->m_rect, whiteColor);
|
||||
|
||||
window->DrawControls();
|
||||
|
||||
@@ -140,19 +141,20 @@ void UpdateBlowerInfo (Dialog *theDialog)
|
||||
if ((thisRoom->objects[objActive].what != kLeftFan) &&
|
||||
(thisRoom->objects[objActive].what != kRightFan))
|
||||
{
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
|
||||
GetDialogItemRect(theDialog, 8, &bounds);
|
||||
bounds.right += 2;
|
||||
bounds.bottom += 2;
|
||||
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(bounds);
|
||||
surface->FillRect(bounds, whiteColor);
|
||||
bounds.right -= 2;
|
||||
bounds.bottom -= 2;
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
|
||||
for (int16_t offsetChunk = 0; offsetChunk < 4; offsetChunk++)
|
||||
{
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
|
||||
const int16_t xOffset = offsetChunk & 1;
|
||||
const int16_t yOffset = (offsetChunk >> 1) & 1;
|
||||
|
||||
@@ -163,36 +165,36 @@ void UpdateBlowerInfo (Dialog *theDialog)
|
||||
case 1: // up
|
||||
{
|
||||
const Point basePoint = offset + Point::Create(bounds.left + HalfRectWide(&bounds), bounds.top);
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(0, RectTall(&bounds)));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(kArrowheadLength, kArrowheadLength));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(-kArrowheadLength, kArrowheadLength));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(0, RectTall(&bounds)), blackColor);
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(kArrowheadLength, kArrowheadLength), blackColor);
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(-kArrowheadLength, kArrowheadLength), blackColor);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: // right
|
||||
{
|
||||
const Point basePoint = offset + Point::Create(bounds.right, bounds.top + HalfRectTall(&bounds));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(-RectWide(&bounds), 0));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(-kArrowheadLength, kArrowheadLength));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(-kArrowheadLength, -kArrowheadLength));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(-RectWide(&bounds), 0), blackColor);
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(-kArrowheadLength, kArrowheadLength), blackColor);
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(-kArrowheadLength, -kArrowheadLength), blackColor);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: // down
|
||||
{
|
||||
const Point basePoint = offset + Point::Create(bounds.left + HalfRectWide(&bounds), bounds.bottom);
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(0, -RectTall(&bounds)));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(kArrowheadLength, -kArrowheadLength));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(-kArrowheadLength, -kArrowheadLength));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(0, -RectTall(&bounds)), blackColor);
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(kArrowheadLength, -kArrowheadLength), blackColor);
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(-kArrowheadLength, -kArrowheadLength), blackColor);
|
||||
}
|
||||
break;
|
||||
|
||||
case 8: // left
|
||||
{
|
||||
const Point basePoint = offset + Point::Create(bounds.left, bounds.top + HalfRectTall(&bounds));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(RectWide(&bounds), 0));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(kArrowheadLength, -kArrowheadLength));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(kArrowheadLength, kArrowheadLength));
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(RectWide(&bounds), 0), blackColor);
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(kArrowheadLength, -kArrowheadLength), blackColor);
|
||||
surface->DrawLine(basePoint, basePoint + Point::Create(kArrowheadLength, kArrowheadLength), blackColor);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -204,33 +206,35 @@ void UpdateBlowerInfo (Dialog *theDialog)
|
||||
if ((thisRoom->objects[objActive].what == kInvisBlower) ||
|
||||
(thisRoom->objects[objActive].what == kLiftArea))
|
||||
{
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
|
||||
switch (newDirection)
|
||||
{
|
||||
case 1: // up
|
||||
EraseDialogItem(theDialog, 11);
|
||||
FrameOvalDialogItem(theDialog, 12);
|
||||
FrameOvalDialogItem(theDialog, 13);
|
||||
FrameOvalDialogItem(theDialog, 14);
|
||||
FrameOvalDialogItem(theDialog, 12, blackColor);
|
||||
FrameOvalDialogItem(theDialog, 13, blackColor);
|
||||
FrameOvalDialogItem(theDialog, 14, blackColor);
|
||||
break;
|
||||
|
||||
case 2: // right
|
||||
FrameOvalDialogItem(theDialog, 11);
|
||||
FrameOvalDialogItem(theDialog, 11, blackColor);
|
||||
EraseDialogItem(theDialog, 12);
|
||||
FrameOvalDialogItem(theDialog, 13);
|
||||
FrameOvalDialogItem(theDialog, 14);
|
||||
FrameOvalDialogItem(theDialog, 13, blackColor);
|
||||
FrameOvalDialogItem(theDialog, 14, blackColor);
|
||||
break;
|
||||
|
||||
case 4: // down
|
||||
FrameOvalDialogItem(theDialog, 11);
|
||||
FrameOvalDialogItem(theDialog, 12);
|
||||
FrameOvalDialogItem(theDialog, 11, blackColor);
|
||||
FrameOvalDialogItem(theDialog, 12, blackColor);
|
||||
EraseDialogItem(theDialog, 13);
|
||||
FrameOvalDialogItem(theDialog, 14);
|
||||
FrameOvalDialogItem(theDialog, 14, blackColor);
|
||||
break;
|
||||
|
||||
case 8: // left
|
||||
FrameOvalDialogItem(theDialog, 11);
|
||||
FrameOvalDialogItem(theDialog, 12);
|
||||
FrameOvalDialogItem(theDialog, 13);
|
||||
FrameOvalDialogItem(theDialog, 11, blackColor);
|
||||
FrameOvalDialogItem(theDialog, 12, blackColor);
|
||||
FrameOvalDialogItem(theDialog, 13, blackColor);
|
||||
EraseDialogItem(theDialog, 14);
|
||||
break;
|
||||
}
|
||||
@@ -732,7 +736,7 @@ void DoBlowerObjectInfo (short what)
|
||||
infoDial = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kBlowerInfoDialogID, kPutInFront, &substitutions);
|
||||
if (infoDial == nil)
|
||||
RedAlert(kErrDialogDidntLoad);
|
||||
SetPort(&infoDial->GetWindow()->GetDrawSurface()->m_port);
|
||||
SetPort(infoDial->GetWindow()->GetDrawSurface());
|
||||
|
||||
newDirection = thisRoom->objects[objActive].data.a.vector & 0x0F;
|
||||
if (thisRoom->objects[objActive].data.a.initial)
|
||||
@@ -1349,7 +1353,7 @@ void DoLightObjectInfo (void)
|
||||
infoDial = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kLightInfoDialogID, kPutInFront, &substitutions);
|
||||
if (infoDial == nil)
|
||||
RedAlert(kErrDialogDidntLoad);
|
||||
SetPort(&infoDial->GetWindow()->GetDrawSurface()->m_port);
|
||||
SetPort(infoDial->GetWindow()->GetDrawSurface());
|
||||
|
||||
if (thisRoom->objects[objActive].data.f.initial)
|
||||
SetDialogItemValue(infoDial, kInitialStateCheckbox, 1);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "House.h"
|
||||
#include "MainWindow.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "Scoreboard.h"
|
||||
|
||||
|
||||
@@ -136,19 +137,21 @@ void NewGame (short mode)
|
||||
|
||||
DrawSurface *mainWindowSurface = mainWindow->GetDrawSurface();
|
||||
|
||||
PortabilityLayer::ResolveCachingColor blackColorMain = StdColors::Black();
|
||||
|
||||
tempRect = thisMac.constrainedScreen;
|
||||
tempRect.top = tempRect.bottom - 20; // thisMac.menuHigh
|
||||
mainWindowSurface->FillRect(tempRect);
|
||||
mainWindowSurface->FillRect(tempRect, blackColorMain);
|
||||
|
||||
#ifdef COMPILEQT
|
||||
if ((thisMac.hasQT) && (hasMovie))
|
||||
{
|
||||
theMovie.m_surface = &mainWindow->m_surface;
|
||||
theMovie.m_surface = mainWindow->GetDrawSurface();
|
||||
}
|
||||
#endif
|
||||
|
||||
workSrcMap->SetForeColor(StdColors::Black());
|
||||
workSrcMap->FillRect(workSrcRect);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor blackColorWork = StdColors::Black();
|
||||
workSrcMap->FillRect(workSrcRect, blackColorWork);
|
||||
// if (quickerTransitions)
|
||||
// DissBitsChunky(&workSrcRect);
|
||||
// else
|
||||
@@ -374,7 +377,7 @@ void HandleGameResolutionChange(void)
|
||||
OpenMainWindow();
|
||||
|
||||
if (hasMovie)
|
||||
theMovie.m_surface = &mainWindow->m_surface;
|
||||
theMovie.m_surface = mainWindow->GetDrawSurface();
|
||||
|
||||
ResetLocale(true);
|
||||
InitScoreboardMap();
|
||||
@@ -752,8 +755,8 @@ void RestoreEntireGameScreen (void)
|
||||
DrawSurface *surface = mainWindow->GetDrawSurface();
|
||||
tempRect = thisMac.constrainedScreen;
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->FillRect(tempRect);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
surface->FillRect(tempRect, blackColor);
|
||||
|
||||
ResetLocale(false);
|
||||
RefreshScoreboard(kNormalTitleMode);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// Given the top left corner and a width and height, this functionÉ
|
||||
// simply creates the necessary rectangle and frames it.
|
||||
|
||||
void FrameWHRect (DrawSurface *surface, short left, short top, short wide, short high)
|
||||
void FrameWHRect (DrawSurface *surface, short left, short top, short wide, short high, PortabilityLayer::ResolveCachingColor &color)
|
||||
{
|
||||
Rect theRect;
|
||||
|
||||
@@ -24,7 +24,7 @@ void FrameWHRect (DrawSurface *surface, short left, short top, short wide, short
|
||||
theRect.top = top;
|
||||
theRect.right = left + wide;
|
||||
theRect.bottom = top + high;
|
||||
surface->FrameRect(theRect);
|
||||
surface->FrameRect(theRect, color);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- NormalizeRect
|
||||
|
||||
@@ -10,8 +10,13 @@
|
||||
|
||||
#include "PLQDraw.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class ResolveCachingColor;
|
||||
}
|
||||
|
||||
void FrameWHRect (short, short, short, short);
|
||||
|
||||
void FrameWHRect (short, short, short, short, PortabilityLayer::ResolveCachingColor &color);
|
||||
void NormalizeRect (Rect *);
|
||||
void ZeroRectCorner (Rect *);
|
||||
void CenterRectOnPoint (Rect *, Point);
|
||||
|
||||
@@ -147,7 +147,7 @@ void DrawReflection (gliderPtr thisGlider, Boolean oneOrTwo)
|
||||
dest = thisGlider->dest;
|
||||
QOffsetRect(&dest, playOriginH - 20, playOriginV - 16);
|
||||
|
||||
SetPort(&workSrcMap->m_port);
|
||||
SetPort(workSrcMap);
|
||||
|
||||
long numMirrorRects = GetHandleSize(mirrorRects.StaticCast<void>()) / sizeof(Rect);
|
||||
|
||||
@@ -612,7 +612,7 @@ void CopyRectsQD (void)
|
||||
{
|
||||
short i;
|
||||
|
||||
DrawSurface *mainWindowGraf = GetWindowPort(mainWindow);
|
||||
DrawSurface *mainWindowGraf = mainWindow->GetDrawSurface();
|
||||
|
||||
for (i = 0; i < numWork2Main; i++)
|
||||
{
|
||||
@@ -713,7 +713,7 @@ void CopyRectWorkToBack (Rect *theRect)
|
||||
void CopyRectWorkToMain (Rect *theRect)
|
||||
{
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
|
||||
theRect, theRect, srcCopy);
|
||||
}
|
||||
|
||||
@@ -721,7 +721,7 @@ void CopyRectWorkToMain (Rect *theRect)
|
||||
|
||||
void CopyRectMainToWork (Rect *theRect)
|
||||
{
|
||||
CopyBits(GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
CopyBits(GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
|
||||
(BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
theRect, theRect, srcCopy);
|
||||
}
|
||||
@@ -730,7 +730,7 @@ void CopyRectMainToWork (Rect *theRect)
|
||||
|
||||
void CopyRectMainToBack (Rect *theRect)
|
||||
{
|
||||
CopyBits(GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
CopyBits(GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
theRect, theRect, srcCopy);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLResources.h"
|
||||
#include "PLToolUtils.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "BitmapImage.h"
|
||||
@@ -18,6 +17,7 @@
|
||||
#include "MainWindow.h"
|
||||
#include "MemoryManager.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
|
||||
|
||||
#define kDeleteRoomAlert 1005
|
||||
@@ -246,16 +246,18 @@ void ReadyBackground (short theID, short *theTiles)
|
||||
|
||||
if ((noRoomAtAll) || (!houseUnlocked))
|
||||
{
|
||||
LtGrayForeColor(workSrcMap);
|
||||
workSrcMap->FillRect(workSrcRect);
|
||||
workSrcMap->SetForeColor(StdColors::Black());
|
||||
workSrcMap->SetApplicationFont(9, PortabilityLayer::FontFamilyFlag_None);
|
||||
PortabilityLayer::ResolveCachingColor ltGrayColor = LtGrayForeColor();
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
|
||||
workSrcMap->FillRect(workSrcRect, ltGrayColor);
|
||||
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(9, PortabilityLayer::FontFamilyFlag_None, true);
|
||||
|
||||
const Point textPoint = Point::Create(10, 20);
|
||||
if (houseUnlocked)
|
||||
workSrcMap->DrawString(textPoint, PSTR("No rooms"), true);
|
||||
workSrcMap->DrawString(textPoint, PSTR("No rooms"), blackColor, appFont);
|
||||
else
|
||||
workSrcMap->DrawString(textPoint, PSTR("Nothing to show"), true);
|
||||
workSrcMap->DrawString(textPoint, PSTR("Nothing to show"), blackColor, appFont);
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
(BitMap *)*GetGWorldPixMap(backSrcMap),
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "Environ.h"
|
||||
#include "MainWindow.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "Room.h"
|
||||
#include "BitmapImage.h"
|
||||
|
||||
@@ -82,8 +83,8 @@ void ResetLocale (Boolean soft)
|
||||
DrawSurface *wasCPort = GetGraphicsPort();
|
||||
const short roomV = (*thisHouse)->rooms[thisRoomNumber].floor;
|
||||
|
||||
backSrcMap->SetForeColor(StdColors::Black());
|
||||
backSrcMap->FillRect(backSrcRect);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
backSrcMap->FillRect(backSrcRect, blackColor);
|
||||
|
||||
if (numNeighbors > 3)
|
||||
{
|
||||
@@ -185,8 +186,8 @@ void DrawRoomBackground (short who, short where, short elevation)
|
||||
|
||||
if ((numLights == 0) && (who != kRoomIsEmpty))
|
||||
{
|
||||
backSrcMap->SetForeColor(StdColors::Black());
|
||||
backSrcMap->FillRect(localRoomsDest[where]);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
backSrcMap->FillRect(localRoomsDest[where], blackColor);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -195,8 +196,8 @@ void DrawRoomBackground (short who, short where, short elevation)
|
||||
{
|
||||
if (wardBitSet)
|
||||
{
|
||||
backSrcMap->SetForeColor(StdColors::Black());
|
||||
backSrcMap->FillRect(localRoomsDest[where]);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
backSrcMap->FillRect(localRoomsDest[where], blackColor);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "PLPopupMenuWidget.h"
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
#include "QDPixMap.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "ResourceCompiledRef.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "Utilities.h"
|
||||
@@ -117,11 +118,13 @@ void UpdateRoomInfoDialog (Dialog *theDialog)
|
||||
SetDialogString(theDialog, kLitUnlitText, PSTR("(Room Is Dark)"));
|
||||
else
|
||||
SetDialogString(theDialog, kLitUnlitText, PSTR("(Room Is Lit)"));
|
||||
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
|
||||
FrameDialogItemC(theDialog, kRoomLocationBox, kRedOrangeColor8);
|
||||
FrameDialogItem(theDialog, kRoomTilesBox);
|
||||
FrameDialogItem(theDialog, kRoomTilesBox, blackColor);
|
||||
FrameDialogItemC(theDialog, kRoomDividerLine, kRedOrangeColor8);
|
||||
FrameDialogItem(theDialog, kRoomTilesBox2);
|
||||
FrameDialogItem(theDialog, kRoomTilesBox2, blackColor);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -134,6 +137,9 @@ void DragMiniTile (Window *window, DrawSurface *surface, Point mouseIs, short *n
|
||||
Point mouseWas;
|
||||
short wasTileOver;
|
||||
Pattern dummyPattern;
|
||||
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
PortabilityLayer::ResolveCachingColor blueColor = StdColors::Blue();
|
||||
|
||||
tileOver = (mouseIs.h - tileSrc.left) / kMiniTileWide;
|
||||
wasTileOver = -1;
|
||||
@@ -161,14 +167,13 @@ void DragMiniTile (Window *window, DrawSurface *surface, Point mouseIs, short *n
|
||||
*newTileOver = (mouseIs.h - tileDest.left) / kMiniTileWide;
|
||||
if (*newTileOver != wasTileOver)
|
||||
{
|
||||
surface->SetForeColor(StdColors::Blue());
|
||||
|
||||
for (int offset = 0; offset < 2; offset++)
|
||||
{
|
||||
Point pointA = Point::Create(tileDest.left + (*newTileOver * kMiniTileWide), tileDest.top - 3 + offset);
|
||||
Point pointB = Point::Create(pointA.h + kMiniTileWide, pointA.v);
|
||||
|
||||
surface->DrawLine(pointA, pointB);
|
||||
surface->DrawLine(pointA, pointB, blueColor);
|
||||
}
|
||||
|
||||
for (int offset = 0; offset < 2; offset++)
|
||||
@@ -176,19 +181,17 @@ void DragMiniTile (Window *window, DrawSurface *surface, Point mouseIs, short *n
|
||||
Point pointA = Point::Create(tileDest.left + (*newTileOver * kMiniTileWide), tileDest.bottom + 1 + offset);
|
||||
Point pointB = Point::Create(pointA.h + kMiniTileWide, pointA.v);
|
||||
|
||||
surface->DrawLine(pointA, pointB);
|
||||
surface->DrawLine(pointA, pointB, blueColor);
|
||||
}
|
||||
|
||||
if (wasTileOver != -1)
|
||||
{
|
||||
surface->SetForeColor(StdColors::White());
|
||||
|
||||
for (int offset = 0; offset < 2; offset++)
|
||||
{
|
||||
Point pointA = Point::Create(tileDest.left + (wasTileOver * kMiniTileWide), tileDest.top - 3 + offset);
|
||||
Point pointB = Point::Create(pointA.h + kMiniTileWide, pointA.v);
|
||||
|
||||
surface->DrawLine(pointA, pointB);
|
||||
surface->DrawLine(pointA, pointB, whiteColor);
|
||||
}
|
||||
|
||||
for (int offset = 0; offset < 2; offset++)
|
||||
@@ -196,7 +199,7 @@ void DragMiniTile (Window *window, DrawSurface *surface, Point mouseIs, short *n
|
||||
Point pointA = Point::Create(tileDest.left + (wasTileOver * kMiniTileWide), tileDest.bottom + 1 + offset);
|
||||
Point pointB = Point::Create(pointA.h + kMiniTileWide, pointA.v);
|
||||
|
||||
surface->DrawLine(pointA, pointB);
|
||||
surface->DrawLine(pointA, pointB, whiteColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,14 +211,12 @@ void DragMiniTile (Window *window, DrawSurface *surface, Point mouseIs, short *n
|
||||
*newTileOver = -1; // we're not in the drop zone
|
||||
if (wasTileOver != -1)
|
||||
{
|
||||
surface->SetForeColor(StdColors::White());
|
||||
|
||||
for (int offset = 0; offset < 2; offset++)
|
||||
{
|
||||
Point pointA = Point::Create(tileDest.left + (wasTileOver * kMiniTileWide), tileDest.top - 3 + offset);
|
||||
Point pointB = Point::Create(pointA.h + kMiniTileWide, pointA.v);
|
||||
|
||||
surface->DrawLine(pointA, pointB);
|
||||
surface->DrawLine(pointA, pointB, whiteColor);
|
||||
}
|
||||
|
||||
for (int offset = 0; offset < 2; offset++)
|
||||
@@ -223,7 +224,7 @@ void DragMiniTile (Window *window, DrawSurface *surface, Point mouseIs, short *n
|
||||
Point pointA = Point::Create(tileDest.left + (wasTileOver * kMiniTileWide), tileDest.bottom + 1 + offset);
|
||||
Point pointB = Point::Create(pointA.h + kMiniTileWide, pointA.v);
|
||||
|
||||
surface->DrawLine(pointA, pointB);
|
||||
surface->DrawLine(pointA, pointB, whiteColor);
|
||||
}
|
||||
|
||||
wasTileOver = -1;
|
||||
@@ -235,14 +236,12 @@ void DragMiniTile (Window *window, DrawSurface *surface, Point mouseIs, short *n
|
||||
}
|
||||
if (wasTileOver != -1)
|
||||
{
|
||||
surface->SetForeColor(StdColors::White());
|
||||
|
||||
for (int offset = 0; offset < 2; offset++)
|
||||
{
|
||||
Point pointA = Point::Create(tileDest.left + (wasTileOver * kMiniTileWide), tileDest.top - 3 + offset);
|
||||
Point pointB = Point::Create(pointA.h + kMiniTileWide, pointA.v);
|
||||
|
||||
surface->DrawLine(pointA, pointB);
|
||||
surface->DrawLine(pointA, pointB, whiteColor);
|
||||
}
|
||||
|
||||
for (int offset = 0; offset < 2; offset++)
|
||||
@@ -250,7 +249,7 @@ void DragMiniTile (Window *window, DrawSurface *surface, Point mouseIs, short *n
|
||||
Point pointA = Point::Create(tileDest.left + (wasTileOver * kMiniTileWide), tileDest.bottom + 1 + offset);
|
||||
Point pointB = Point::Create(pointA.h + kMiniTileWide, pointA.v);
|
||||
|
||||
surface->DrawLine(pointA, pointB);
|
||||
surface->DrawLine(pointA, pointB, whiteColor);
|
||||
}
|
||||
|
||||
wasTileOver = -1;
|
||||
@@ -265,6 +264,8 @@ void DragMiniTile (Window *window, DrawSurface *surface, Point mouseIs, short *n
|
||||
void HiliteTileOver (DrawSurface *surface, Point mouseIs)
|
||||
{
|
||||
short newTileOver;
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
PortabilityLayer::ResolveCachingColor redColor = StdColors::Red();
|
||||
|
||||
if (tileSrc.Contains(mouseIs))
|
||||
{
|
||||
@@ -277,33 +278,27 @@ void HiliteTileOver (DrawSurface *surface, Point mouseIs)
|
||||
newTileOver = (mouseIs.h - tileSrc.left) / kMiniTileWide;
|
||||
if (newTileOver != tileOver)
|
||||
{
|
||||
surface->SetForeColor(StdColors::Red());
|
||||
|
||||
{
|
||||
const Point tileLineTopLeft = Point::Create(tileSrc.left + (newTileOver * kMiniTileWide), tileSrc.top - 3);
|
||||
const Point tileLineBottomRight = Point::Create(tileLineTopLeft.h + kMiniTileWide + 1, tileLineTopLeft.v + 2);
|
||||
surface->FillRect(Rect::Create(tileLineTopLeft.v, tileLineTopLeft.h, tileLineBottomRight.v, tileLineBottomRight.h));
|
||||
surface->FillRect(Rect::Create(tileLineTopLeft.v, tileLineTopLeft.h, tileLineBottomRight.v, tileLineBottomRight.h), redColor);
|
||||
}
|
||||
|
||||
if (tileOver != -1)
|
||||
{
|
||||
surface->SetForeColor(StdColors::White());
|
||||
|
||||
{
|
||||
const Point tileLineTopLeft = Point::Create(tileSrc.left + (tileOver * kMiniTileWide), tileSrc.top - 3);
|
||||
const Point tileLineBottomRight = Point::Create(tileLineTopLeft.h + kMiniTileWide + 1, tileLineTopLeft.v + 2);
|
||||
surface->FillRect(Rect::Create(tileLineTopLeft.v, tileLineTopLeft.h, tileLineBottomRight.v, tileLineBottomRight.h));
|
||||
surface->FillRect(Rect::Create(tileLineTopLeft.v, tileLineTopLeft.h, tileLineBottomRight.v, tileLineBottomRight.h), whiteColor);
|
||||
}
|
||||
|
||||
{
|
||||
const Point tileLineTopLeft = Point::Create(tileSrc.left + (tileOver * kMiniTileWide), tileSrc.bottom + 1);
|
||||
const Point tileLineBottomRight = Point::Create(tileLineTopLeft.h + kMiniTileWide + 1, tileLineTopLeft.v + 2);
|
||||
surface->FillRect(Rect::Create(tileLineTopLeft.v, tileLineTopLeft.h, tileLineBottomRight.v, tileLineBottomRight.h));
|
||||
surface->FillRect(Rect::Create(tileLineTopLeft.v, tileLineTopLeft.h, tileLineBottomRight.v, tileLineBottomRight.h), whiteColor);
|
||||
}
|
||||
}
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
|
||||
tileOver = newTileOver;
|
||||
}
|
||||
}
|
||||
@@ -311,21 +306,18 @@ void HiliteTileOver (DrawSurface *surface, Point mouseIs)
|
||||
{
|
||||
if (tileOver != -1)
|
||||
{
|
||||
surface->SetForeColor(StdColors::White());
|
||||
|
||||
{
|
||||
const Point tileLineTopLeft = Point::Create(tileSrc.left + (tileOver * kMiniTileWide), tileSrc.top - 3);
|
||||
const Point tileLineBottomRight = Point::Create(tileLineTopLeft.h + kMiniTileWide + 1, tileLineTopLeft.v + 2);
|
||||
surface->FillRect(Rect::Create(tileLineTopLeft.v, tileLineTopLeft.h, tileLineBottomRight.v, tileLineBottomRight.h));
|
||||
surface->FillRect(Rect::Create(tileLineTopLeft.v, tileLineTopLeft.h, tileLineBottomRight.v, tileLineBottomRight.h), whiteColor);
|
||||
}
|
||||
|
||||
{
|
||||
const Point tileLineTopLeft = Point::Create(tileSrc.left + (tileOver * kMiniTileWide), tileSrc.bottom + 1);
|
||||
const Point tileLineBottomRight = Point::Create(tileLineTopLeft.h + kMiniTileWide + 1, tileLineTopLeft.v + 2);
|
||||
surface->FillRect(Rect::Create(tileLineTopLeft.v, tileLineTopLeft.h, tileLineBottomRight.v, tileLineBottomRight.h));
|
||||
surface->FillRect(Rect::Create(tileLineTopLeft.v, tileLineTopLeft.h, tileLineBottomRight.v, tileLineBottomRight.h), whiteColor);
|
||||
}
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
tileOver = -1;
|
||||
}
|
||||
|
||||
@@ -391,7 +383,7 @@ int16_t RoomFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
if (evt->IsLMouseDownEvent())
|
||||
{
|
||||
mouseIs = Point::Create(mouseEvent.m_x, mouseEvent.m_y);
|
||||
mouseIs -= dial->GetWindow()->TopLeftCoord();
|
||||
mouseIs -= dial->GetWindow()->GetTopLeftCoord();
|
||||
if (tileSrc.Contains(mouseIs))
|
||||
{
|
||||
if (StillDown())
|
||||
@@ -465,7 +457,7 @@ void DoRoomInfo(void)
|
||||
roomInfoDialog = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kRoomInfoDialogID, kPutInFront, &substitutions);
|
||||
if (roomInfoDialog == nil)
|
||||
RedAlert(kErrDialogDidntLoad);
|
||||
SetPort(&roomInfoDialog->GetWindow()->GetDrawSurface()->m_port);
|
||||
SetPort(roomInfoDialog->GetWindow()->GetDrawSurface());
|
||||
|
||||
{
|
||||
PortabilityLayer::WidgetBasicState state;
|
||||
@@ -474,7 +466,7 @@ void DoRoomInfo(void)
|
||||
state.m_resID = kBackgroundsMenuID;
|
||||
state.m_enabled = true;
|
||||
|
||||
PortabilityLayer::PopupMenuWidget *roomPopupWidget = PortabilityLayer::PopupMenuWidget::Create(state);
|
||||
PortabilityLayer::PopupMenuWidget *roomPopupWidget = PortabilityLayer::PopupMenuWidget::Create(state, nullptr);
|
||||
roomInfoDialog->ReplaceWidget(kRoomPopupItem - 1, roomPopupWidget);
|
||||
|
||||
if (HouseHasOriginalPicts())
|
||||
@@ -681,7 +673,7 @@ int16_t OriginalArtFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
const GpMouseInputEvent &mouseEvt = evt->m_vosEvent.m_event.m_mouseInputEvent;
|
||||
|
||||
mouseIs = Point::Create(mouseEvt.m_x, mouseEvt.m_y);
|
||||
mouseIs -= dial->GetWindow()->TopLeftCoord();
|
||||
mouseIs -= dial->GetWindow()->GetTopLeftCoord();
|
||||
if (leftBound.Contains(mouseIs))
|
||||
return 7;
|
||||
else if (topBound.Contains(mouseIs))
|
||||
|
||||
@@ -42,7 +42,7 @@ void SaveGame2 (void)
|
||||
PortabilityLayer::InputManager::GetInstance()->ClearState();
|
||||
|
||||
Str255 gameNameStr;
|
||||
Size byteCount;
|
||||
size_t byteCount;
|
||||
houseType *thisHousePtr;
|
||||
roomType *srcRoom;
|
||||
savedRoom *destRoom;
|
||||
@@ -54,7 +54,7 @@ void SaveGame2 (void)
|
||||
PortabilityLayer::MemoryManager *mm = PortabilityLayer::MemoryManager::GetInstance();
|
||||
PortabilityLayer::FileManager *fm = PortabilityLayer::FileManager::GetInstance();
|
||||
|
||||
FlushEvents(everyEvent, 0);
|
||||
FlushEvents();
|
||||
|
||||
thisHousePtr = *thisHouse;
|
||||
|
||||
|
||||
@@ -10,10 +10,14 @@
|
||||
#include "PLPasStr.h"
|
||||
#include "Externs.h"
|
||||
#include "Environ.h"
|
||||
#include "FontFamily.h"
|
||||
#include "MenuManager.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "QDPixMap.h"
|
||||
#include "QDStandardPalette.h"
|
||||
#include "RectUtils.h"
|
||||
#include "RenderedFont.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
|
||||
|
||||
#define kGrayBackgroundColor 251
|
||||
@@ -56,7 +60,7 @@ extern Boolean evenFrame, onePlayerLeft;
|
||||
|
||||
void MarkScoreboardPortDirty(void)
|
||||
{
|
||||
GetWindowPort(boardWindow)->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||
boardWindow->GetDrawSurface()->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- RefreshScoreboard
|
||||
@@ -71,7 +75,7 @@ void RefreshScoreboard (SInt16 mode)
|
||||
RefreshPoints();
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(boardSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(boardWindow)),
|
||||
GetPortBitMapForCopyBits(boardWindow->GetDrawSurface()),
|
||||
&boardSrcRect, &boardDestRect, srcCopy);
|
||||
|
||||
MarkScoreboardPortDirty();
|
||||
@@ -153,48 +157,44 @@ void RefreshRoomTitle (short mode)
|
||||
{
|
||||
DrawSurface *surface = boardTSrcMap;
|
||||
|
||||
PortabilityLayer::RGBAColor theRGBColor, wasColor;
|
||||
PortabilityLayer::ResolveCachingColor theRGBColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(kGrayBackgroundColor);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
|
||||
wasColor = surface->GetForeColor();
|
||||
theRGBColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[kGrayBackgroundColor];
|
||||
surface->SetForeColor(theRGBColor);
|
||||
surface->FillRect(boardTSrcRect);
|
||||
surface->SetForeColor(wasColor);
|
||||
surface->FillRect(boardTSrcRect, theRGBColor);
|
||||
|
||||
const Point strShadowPoint = Point::Create(1, 10);
|
||||
const Point strPoint = Point::Create(0, 9);
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case kEscapedTitleMode:
|
||||
surface->DrawString(strShadowPoint, PSTR("Hit Delete key if unable to Follow"), true);
|
||||
surface->DrawString(strShadowPoint, PSTR("Hit Delete key if unable to Follow"), blackColor, appFont);
|
||||
break;
|
||||
|
||||
case kSavingTitleMode:
|
||||
surface->DrawString(strShadowPoint, PSTR("Saving GameÉ"), true);
|
||||
surface->DrawString(strShadowPoint, PSTR("Saving GameÉ"), blackColor, appFont);
|
||||
break;
|
||||
|
||||
default:
|
||||
surface->DrawString(strShadowPoint, thisRoom->name, true);
|
||||
surface->DrawString(strShadowPoint, thisRoom->name, blackColor, appFont);
|
||||
break;
|
||||
}
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(255, 255, 255, 255));
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case kEscapedTitleMode:
|
||||
surface->DrawString(strPoint, PSTR("Hit Delete key if unable to Follow"), true);
|
||||
surface->DrawString(strPoint, PSTR("Hit Delete key if unable to Follow"), whiteColor, appFont);
|
||||
break;
|
||||
|
||||
case kSavingTitleMode:
|
||||
surface->DrawString(strPoint, PSTR("Saving GameÉ"), true);
|
||||
surface->DrawString(strPoint, PSTR("Saving GameÉ"), whiteColor, appFont);
|
||||
break;
|
||||
|
||||
default:
|
||||
surface->DrawString(strPoint, thisRoom->name, true);
|
||||
surface->DrawString(strPoint, thisRoom->name, whiteColor, appFont);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -207,16 +207,17 @@ void RefreshRoomTitle (short mode)
|
||||
|
||||
void RefreshNumGliders (void)
|
||||
{
|
||||
PortabilityLayer::RGBAColor theRGBColor, wasColor;
|
||||
Str255 nGlidersStr;
|
||||
long displayMortals;
|
||||
DrawSurface *surface = boardGSrcMap;
|
||||
|
||||
theRGBColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[kGrayBackgroundColor];
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(theRGBColor);
|
||||
surface->FillRect(boardGSrcRect);
|
||||
PortabilityLayer::ResolveCachingColor theRGBColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(kGrayBackgroundColor);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
|
||||
surface->FillRect(boardGSrcRect, theRGBColor);
|
||||
|
||||
displayMortals = mortals;
|
||||
if (displayMortals < 0)
|
||||
@@ -226,11 +227,8 @@ void RefreshNumGliders (void)
|
||||
const Point shadowPoint = Point::Create(1, 10);
|
||||
const Point textPoint = Point::Create(0, 9);
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
|
||||
surface->DrawString(shadowPoint, nGlidersStr, true);
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(255, 255, 255, 255));
|
||||
surface->DrawString(textPoint, nGlidersStr, true);
|
||||
surface->DrawString(shadowPoint, nGlidersStr, blackColor, appFont);
|
||||
surface->DrawString(textPoint, nGlidersStr, whiteColor, appFont);
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(boardGSrcMap),
|
||||
(BitMap *)*GetGWorldPixMap(boardSrcMap),
|
||||
@@ -241,25 +239,24 @@ void RefreshNumGliders (void)
|
||||
|
||||
void RefreshPoints (void)
|
||||
{
|
||||
PortabilityLayer::RGBAColor theRGBColor, wasColor;
|
||||
Str255 scoreStr;
|
||||
DrawSurface *surface = boardPSrcMap;
|
||||
|
||||
theRGBColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[kGrayBackgroundColor];
|
||||
PortabilityLayer::ResolveCachingColor theRGBColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(kGrayBackgroundColor);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
|
||||
surface->SetForeColor(theRGBColor);
|
||||
surface->FillRect(boardPSrcRect);
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
surface->FillRect(boardPSrcRect, theRGBColor);
|
||||
|
||||
NumToString(theScore, scoreStr);
|
||||
|
||||
const Point shadowPoint = Point::Create(1, 10);
|
||||
const Point textPoint = Point::Create(0, 9);
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
|
||||
surface->DrawString(shadowPoint, scoreStr, true);
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(255, 255, 255, 255));
|
||||
surface->DrawString(textPoint, scoreStr, true);
|
||||
surface->DrawString(shadowPoint, scoreStr, blackColor, appFont);
|
||||
surface->DrawString(textPoint, scoreStr, whiteColor, appFont);
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(boardPSrcMap),
|
||||
(BitMap *)*GetGWorldPixMap(boardSrcMap),
|
||||
@@ -272,28 +269,27 @@ void RefreshPoints (void)
|
||||
|
||||
void QuickGlidersRefresh (void)
|
||||
{
|
||||
PortabilityLayer::RGBAColor theRGBColor, wasColor;
|
||||
Str255 nGlidersStr;
|
||||
DrawSurface *surface = boardGSrcMap;
|
||||
|
||||
theRGBColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[kGrayBackgroundColor];
|
||||
PortabilityLayer::ResolveCachingColor theRGBColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(kGrayBackgroundColor);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
|
||||
surface->SetForeColor(theRGBColor);
|
||||
surface->FillRect(boardGSrcRect);
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
surface->FillRect(boardGSrcRect, theRGBColor);
|
||||
|
||||
NumToString((long)mortals, nGlidersStr);
|
||||
|
||||
const Point shadowPoint = Point::Create(1, 10);
|
||||
const Point textPoint = Point::Create(0, 9);
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
|
||||
surface->DrawString(shadowPoint, nGlidersStr, true);
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(255, 255, 255, 255));
|
||||
surface->DrawString(textPoint, nGlidersStr, true);
|
||||
surface->DrawString(shadowPoint, nGlidersStr, blackColor, appFont);
|
||||
surface->DrawString(textPoint, nGlidersStr, whiteColor, appFont);
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(boardGSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(boardWindow)),
|
||||
GetPortBitMapForCopyBits(boardWindow->GetDrawSurface()),
|
||||
&boardGSrcRect, &boardGQDestRect, srcCopy);
|
||||
|
||||
MarkScoreboardPortDirty();
|
||||
@@ -303,27 +299,27 @@ void QuickGlidersRefresh (void)
|
||||
|
||||
void QuickScoreRefresh (void)
|
||||
{
|
||||
PortabilityLayer::RGBAColor theRGBColor, wasColor;
|
||||
Str255 scoreStr;
|
||||
DrawSurface *surface = boardPSrcMap;
|
||||
|
||||
theRGBColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[kGrayBackgroundColor];
|
||||
surface->SetForeColor(theRGBColor);
|
||||
surface->FillRect(boardPSrcRect);
|
||||
PortabilityLayer::ResolveCachingColor theRGBColor = PortabilityLayer::ResolveCachingColor::FromStandardColor(kGrayBackgroundColor);
|
||||
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
|
||||
surface->FillRect(boardPSrcRect, theRGBColor);
|
||||
|
||||
NumToString(displayedScore, scoreStr);
|
||||
|
||||
const Point shadowPoint = Point::Create(1, 10);
|
||||
const Point textPoint = Point::Create(0, 9);
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
|
||||
surface->DrawString(shadowPoint, scoreStr, true);
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(255, 255, 255, 255));
|
||||
surface->DrawString(textPoint, scoreStr, true);
|
||||
surface->DrawString(shadowPoint, scoreStr, blackColor, appFont);
|
||||
surface->DrawString(textPoint, scoreStr, whiteColor, appFont);
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(boardPSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(boardWindow)),
|
||||
GetPortBitMapForCopyBits(boardWindow->GetDrawSurface()),
|
||||
&boardPSrcRect, &boardPQDestRect, srcCopy);
|
||||
|
||||
MarkScoreboardPortDirty();
|
||||
@@ -336,7 +332,7 @@ void QuickBatteryRefresh (Boolean flash)
|
||||
if ((batteryTotal > 0) && (!flash))
|
||||
{
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(badgeSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(boardWindow)),
|
||||
GetPortBitMapForCopyBits(boardWindow->GetDrawSurface()),
|
||||
&badgesBadgesRects[kBatteryBadge],
|
||||
&badgesDestRects[kBatteryBadge],
|
||||
srcCopy);
|
||||
@@ -344,7 +340,7 @@ void QuickBatteryRefresh (Boolean flash)
|
||||
else if ((batteryTotal < 0) && (!flash))
|
||||
{
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(badgeSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(boardWindow)),
|
||||
GetPortBitMapForCopyBits(boardWindow->GetDrawSurface()),
|
||||
&badgesBadgesRects[kHeliumBadge],
|
||||
&badgesDestRects[kHeliumBadge],
|
||||
srcCopy);
|
||||
@@ -352,7 +348,7 @@ void QuickBatteryRefresh (Boolean flash)
|
||||
else
|
||||
{
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(badgeSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(boardWindow)),
|
||||
GetPortBitMapForCopyBits(boardWindow->GetDrawSurface()),
|
||||
&badgesBlankRects[kBatteryBadge],
|
||||
&badgesDestRects[kBatteryBadge],
|
||||
srcCopy);
|
||||
@@ -368,7 +364,7 @@ void QuickBandsRefresh (Boolean flash)
|
||||
if ((bandsTotal > 0) && (!flash))
|
||||
{
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(badgeSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(boardWindow)),
|
||||
GetPortBitMapForCopyBits(boardWindow->GetDrawSurface()),
|
||||
&badgesBadgesRects[kBandsBadge],
|
||||
&badgesDestRects[kBandsBadge],
|
||||
srcCopy);
|
||||
@@ -376,7 +372,7 @@ void QuickBandsRefresh (Boolean flash)
|
||||
else
|
||||
{
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(badgeSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(boardWindow)),
|
||||
GetPortBitMapForCopyBits(boardWindow->GetDrawSurface()),
|
||||
&badgesBlankRects[kBandsBadge],
|
||||
&badgesDestRects[kBandsBadge],
|
||||
srcCopy);
|
||||
@@ -392,7 +388,7 @@ void QuickFoilRefresh (Boolean flash)
|
||||
if ((foilTotal > 0) && (!flash))
|
||||
{
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(badgeSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(boardWindow)),
|
||||
GetPortBitMapForCopyBits(boardWindow->GetDrawSurface()),
|
||||
&badgesBadgesRects[kFoilBadge],
|
||||
&badgesDestRects[kFoilBadge],
|
||||
srcCopy);
|
||||
@@ -400,7 +396,7 @@ void QuickFoilRefresh (Boolean flash)
|
||||
else
|
||||
{
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(badgeSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(boardWindow)),
|
||||
GetPortBitMapForCopyBits(boardWindow->GetDrawSurface()),
|
||||
&badgesBlankRects[kFoilBadge],
|
||||
&badgesDestRects[kFoilBadge],
|
||||
srcCopy);
|
||||
|
||||
@@ -17,10 +17,12 @@
|
||||
#include "FileManager.h"
|
||||
#include "House.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "ResourceFile.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
#include "VirtualDirectory.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
|
||||
#define kLoadHouseDialogID 1000
|
||||
@@ -156,9 +158,8 @@ void PageUpHouses (Dialog *theDial)
|
||||
|
||||
QSetRect(&tempRect, 8, 39, 421, 223);
|
||||
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(tempRect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
surface->FillRect(tempRect, whiteColor);
|
||||
|
||||
UpdateLoadDialog(theDial);
|
||||
}
|
||||
@@ -190,9 +191,8 @@ void PageDownHouses (Dialog *theDial)
|
||||
}
|
||||
|
||||
QSetRect(&tempRect, 8, 39, 421, 223);
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(tempRect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
surface->FillRect(tempRect, whiteColor);
|
||||
|
||||
UpdateLoadDialog(theDial);
|
||||
}
|
||||
@@ -343,6 +343,8 @@ void DoLoadHouse (void)
|
||||
Dialog *theDial;
|
||||
short i, wasIndex, screenCount;
|
||||
Boolean leaving, whoCares;
|
||||
|
||||
PortabilityLayer::WindowManager *wm = PortabilityLayer::WindowManager::GetInstance();
|
||||
|
||||
BringUpDialog(&theDial, kLoadHouseDialogID, nullptr);
|
||||
|
||||
@@ -389,6 +391,9 @@ void DoLoadHouse (void)
|
||||
|
||||
leaving = false;
|
||||
|
||||
Window *exclWindow = theDial->GetWindow();
|
||||
wm->SwapExclusiveWindow(exclWindow); // Push exclusive window
|
||||
|
||||
UpdateLoadDialog(theDial);
|
||||
|
||||
while (!leaving)
|
||||
@@ -496,6 +501,8 @@ void DoLoadHouse (void)
|
||||
UpdateLoadDialog(theDial);
|
||||
}
|
||||
|
||||
wm->SwapExclusiveWindow(exclWindow); // Pop exclusive window
|
||||
|
||||
theDial->Destroy();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -9,14 +9,15 @@
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLSound.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "PLTextUtils.h"
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
#include "PLWidgets.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "DialogManager.h"
|
||||
#include "DialogUtils.h"
|
||||
#include "Externs.h"
|
||||
#include "Environ.h"
|
||||
#include "House.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
|
||||
#define kMainPrefsDialID 1012
|
||||
@@ -347,27 +348,26 @@ void UpdateSettingsControl (Dialog *theDialog)
|
||||
{
|
||||
short i;
|
||||
DrawSurface *surface = theDialog->GetWindow()->GetDrawSurface();
|
||||
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(255, 255, 255, 255));
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
Rect rect = controlRects[i];
|
||||
surface->FrameRect(rect);
|
||||
surface->FrameRect(rect, whiteColor);
|
||||
InsetRect(&rect, 1, 1);
|
||||
surface->FrameRect(rect);
|
||||
surface->FrameRect(rect, whiteColor);
|
||||
}
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(255, 0, 0, 255));
|
||||
PortabilityLayer::ResolveCachingColor redColor = StdColors::Red();
|
||||
|
||||
{
|
||||
Rect rect = controlRects[whichCtrl];
|
||||
surface->FrameRect(rect);
|
||||
surface->FrameRect(rect, redColor);
|
||||
InsetRect(&rect, 1, 1);
|
||||
surface->FrameRect(rect);
|
||||
surface->FrameRect(rect, redColor);
|
||||
}
|
||||
|
||||
surface->SetForeColor(PortabilityLayer::RGBAColor::Create(0, 0, 0, 255));
|
||||
|
||||
UpdateControlKeyName(theDialog);
|
||||
FrameDialogItemC(theDialog, 3, kRedOrangeColor8);
|
||||
}
|
||||
@@ -493,7 +493,7 @@ void DoControlPrefs (void)
|
||||
prefDlg = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kControlPrefsDialID, kPutInFront, nullptr);
|
||||
if (prefDlg == nil)
|
||||
RedAlert(kErrDialogDidntLoad);
|
||||
SetGraphicsPort(&prefDlg->GetWindow()->m_surface);
|
||||
SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface());
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
GetDialogItemRect(prefDlg, i + kRightControl, &controlRects[i]);
|
||||
@@ -554,18 +554,20 @@ void DoControlPrefs (void)
|
||||
{
|
||||
Rect ctrlRect = controlRects[whichCtrl];
|
||||
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FrameRect(ctrlRect);
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
surface->FrameRect(ctrlRect, whiteColor);
|
||||
InsetRect(&ctrlRect, 1, 1);
|
||||
surface->FrameRect(ctrlRect);
|
||||
surface->FrameRect(ctrlRect, whiteColor);
|
||||
|
||||
whichCtrl = itemHit - kRightControl;
|
||||
|
||||
ctrlRect = controlRects[whichCtrl];
|
||||
surface->SetForeColor(StdColors::Red());
|
||||
surface->FrameRect(ctrlRect);
|
||||
|
||||
|
||||
PortabilityLayer::ResolveCachingColor redColor = StdColors::Red();
|
||||
surface->FrameRect(ctrlRect, redColor);
|
||||
InsetRect(&ctrlRect, 1, 1);
|
||||
surface->FrameRect(ctrlRect);
|
||||
surface->FrameRect(ctrlRect, redColor);
|
||||
}
|
||||
|
||||
UpdateControlKeyName(prefDlg);
|
||||
@@ -725,6 +727,8 @@ void DoSoundPrefs (void)
|
||||
PLError_t theErr;
|
||||
short itemHit;
|
||||
Boolean leaving;
|
||||
|
||||
PortabilityLayer::WindowManager *wm = PortabilityLayer::WindowManager::GetInstance();
|
||||
|
||||
BringUpDialog(&prefDlg, kSoundPrefsDialID, nullptr);
|
||||
|
||||
@@ -740,6 +744,9 @@ void DoSoundPrefs (void)
|
||||
SetDialogItemValue(prefDlg, kPlayMusicItem, (short)wasPlay);
|
||||
leaving = false;
|
||||
|
||||
Window *exclStack = prefDlg->GetWindow();
|
||||
wm->SwapExclusiveWindow(exclStack); // Push exclusive window
|
||||
|
||||
while (!leaving)
|
||||
{
|
||||
itemHit = prefDlg->ExecuteModal(SoundFilter);
|
||||
@@ -843,6 +850,8 @@ void DoSoundPrefs (void)
|
||||
}
|
||||
}
|
||||
|
||||
wm->SwapExclusiveWindow(exclStack); // Pop exclusive window
|
||||
|
||||
prefDlg->Destroy();
|
||||
}
|
||||
|
||||
@@ -879,15 +888,15 @@ void FrameDisplayIcon (Dialog *theDialog, const PortabilityLayer::RGBAColor &col
|
||||
|
||||
DrawSurface *surface = theDialog->GetWindow()->GetDrawSurface();
|
||||
|
||||
surface->SetForeColor(color);
|
||||
PortabilityLayer::ResolveCachingColor cacheColor = color;
|
||||
|
||||
theRect.left -= 3;
|
||||
theRect.top += 0;
|
||||
theRect.right += 3;
|
||||
theRect.bottom -= 1;
|
||||
surface->FrameRect(theRect);
|
||||
surface->FrameRect(theRect, cacheColor);
|
||||
InsetRect(&theRect, 1, 1);
|
||||
surface->FrameRect(theRect);
|
||||
surface->FrameRect(theRect, cacheColor);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DisplayUpdate
|
||||
@@ -898,9 +907,7 @@ void DisplayUpdate (Dialog *theDialog)
|
||||
|
||||
SetDialogItemValue(theDialog, kDoColorFadeItem, (short)wasFade);
|
||||
|
||||
ForeColor(redColor);
|
||||
FrameDisplayIcon(theDialog, StdColors::Red());
|
||||
ForeColor(blackColor);
|
||||
FrameDialogItemC(theDialog, kBorder1Item, kRedOrangeColor8);
|
||||
FrameDialogItemC(theDialog, kBorder2Item, kRedOrangeColor8);
|
||||
FrameDialogItemC(theDialog, kBorder3Item, kRedOrangeColor8);
|
||||
@@ -1055,7 +1062,6 @@ void DoDisplayPrefs (void)
|
||||
|
||||
case kDispDefault:
|
||||
FrameDisplayIcon(prefDlg, StdColors::White());
|
||||
ForeColor(blackColor);
|
||||
DisplayDefaults();
|
||||
DisplayUpdate(prefDlg);
|
||||
break;
|
||||
@@ -1197,7 +1203,7 @@ int16_t PrefsFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
const Window *window = dial->GetWindow();
|
||||
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);
|
||||
const Point testPt = window->MouseToLocal(evt->m_vosEvent.m_event.m_mouseInputEvent);
|
||||
|
||||
int16_t hitCode = -1;
|
||||
|
||||
@@ -1238,6 +1244,10 @@ void DoSettingsMain (void)
|
||||
|
||||
leaving = false;
|
||||
nextRestartChange = false;
|
||||
|
||||
Window* exclWindow = prefDlg->GetWindow();
|
||||
|
||||
PortabilityLayer::WindowManager::GetInstance()->SwapExclusiveWindow(exclWindow); // Push exclusive window
|
||||
|
||||
while (!leaving)
|
||||
{
|
||||
@@ -1252,20 +1262,20 @@ void DoSettingsMain (void)
|
||||
case kDisplayButton:
|
||||
FlashSettingsButton(surface, 0);
|
||||
DoDisplayPrefs();
|
||||
SetGraphicsPort(&prefDlg->GetWindow()->m_surface);
|
||||
SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface());
|
||||
break;
|
||||
|
||||
case kSoundButton:
|
||||
FlashSettingsButton(surface, 1);
|
||||
DoSoundPrefs();
|
||||
SetGraphicsPort(&prefDlg->GetWindow()->m_surface);
|
||||
FlushEvents(everyEvent, 0);
|
||||
SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface());
|
||||
FlushEvents();
|
||||
break;
|
||||
|
||||
case kControlsButton:
|
||||
FlashSettingsButton(surface, 2);
|
||||
DoControlPrefs();
|
||||
SetGraphicsPort(&prefDlg->GetWindow()->m_surface);
|
||||
SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface());
|
||||
break;
|
||||
|
||||
case kBrainsButton:
|
||||
@@ -1277,7 +1287,7 @@ void DoSettingsMain (void)
|
||||
}
|
||||
FlashSettingsButton(surface, 3);
|
||||
DoBrainsPrefs();
|
||||
SetGraphicsPort(&prefDlg->GetWindow()->m_surface);
|
||||
SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface());
|
||||
break;
|
||||
|
||||
case kAllDefaultsButton:
|
||||
@@ -1285,7 +1295,9 @@ void DoSettingsMain (void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PortabilityLayer::WindowManager::GetInstance()->SwapExclusiveWindow(exclWindow); // Pop exclusive window
|
||||
|
||||
prefDlg->Destroy();
|
||||
|
||||
if (nextRestartChange)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "PLPasStr.h"
|
||||
#include "Externs.h"
|
||||
#include "RenderedFont.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -275,17 +276,17 @@ void GetFirstWordOfString (StringPtr stringIn, StringPtr stringOut)
|
||||
// font. If the text would exceed our width limit, charactersÉ
|
||||
// are dropped off the end of the string and "É" appended.
|
||||
|
||||
void CollapseStringToWidth (DrawSurface *surface, StringPtr theStr, short wide)
|
||||
void CollapseStringToWidth (PortabilityLayer::RenderedFont *font, StringPtr theStr, short wide)
|
||||
{
|
||||
short dotsWide;
|
||||
Boolean tooWide;
|
||||
|
||||
dotsWide = surface->MeasureString(PSTR("É"));
|
||||
tooWide = surface->MeasureString(theStr) > wide;
|
||||
while (tooWide)
|
||||
dotsWide = font->MeasurePStr(PSTR("É"));
|
||||
tooWide = font->MeasurePStr(theStr) > wide;
|
||||
while (tooWide && theStr[0] > 0)
|
||||
{
|
||||
theStr[0]--;
|
||||
tooWide = ((surface->MeasureString(theStr) + dotsWide) > wide);
|
||||
tooWide = ((font->MeasurePStr(theStr) + dotsWide) > wide);
|
||||
if (!tooWide)
|
||||
PasStringConcat(theStr, PSTR("É"));
|
||||
}
|
||||
|
||||
@@ -105,7 +105,6 @@ void InitScoreboardMap(void)
|
||||
if (!boardTSrcMap)
|
||||
{
|
||||
theErr = CreateOffScreenGWorld(&boardTSrcMap, &boardTSrcRect, kPreferredPixelFormat);
|
||||
boardTSrcMap->SetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
}
|
||||
boardTDestRect = boardTSrcRect;
|
||||
QOffsetRect(&boardTDestRect, 137 + hOffset, 5);
|
||||
@@ -114,7 +113,6 @@ void InitScoreboardMap(void)
|
||||
if (!boardGSrcMap)
|
||||
{
|
||||
theErr = CreateOffScreenGWorld(&boardGSrcMap, &boardGSrcRect, kPreferredPixelFormat);
|
||||
boardGSrcMap->SetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
}
|
||||
boardGDestRect = boardGSrcRect;
|
||||
QOffsetRect(&boardGDestRect, 526 + hOffset, 5);
|
||||
@@ -124,7 +122,6 @@ void InitScoreboardMap(void)
|
||||
if (!boardPSrcMap)
|
||||
{
|
||||
theErr = CreateOffScreenGWorld(&boardPSrcMap, &boardPSrcRect, kPreferredPixelFormat);
|
||||
boardPSrcMap->SetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
}
|
||||
boardPDestRect = boardPSrcRect;
|
||||
QOffsetRect(&boardPDestRect, 570 + hOffset, 5); // total = 6396 pixels
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
//============================================================================
|
||||
|
||||
|
||||
#include "PLTextUtils.h"
|
||||
#include "PLControlDefinitions.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "PLStandardColors.h"
|
||||
@@ -16,6 +15,7 @@
|
||||
#include "PLPopupMenuWidget.h"
|
||||
#include "QDPixMap.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "Utilities.h"
|
||||
#include "WindowDef.h"
|
||||
#include "WindowManager.h"
|
||||
@@ -129,13 +129,12 @@ void FrameSelectedTool (DrawSurface *surface)
|
||||
}
|
||||
|
||||
theRect = toolRects[toolIcon];
|
||||
surface->SetForeColor(StdColors::Red());
|
||||
|
||||
surface->FrameRect(theRect);
|
||||
PortabilityLayer::ResolveCachingColor redColor = StdColors::Red();
|
||||
|
||||
surface->FrameRect(theRect, redColor);
|
||||
InsetRect(&theRect, 1, 1);
|
||||
surface->FrameRect(theRect);
|
||||
|
||||
ForeColor(blackColor);
|
||||
surface->FrameRect(theRect, redColor);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -152,14 +151,13 @@ void DrawToolName (DrawSurface *surface)
|
||||
GetIndString(theString, kObjectNameStrings,
|
||||
toolSelected + ((toolMode - 1) * 0x0010));
|
||||
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(toolTextRect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
surface->FillRect(toolTextRect, whiteColor);
|
||||
|
||||
const Point textPoint = Point::Create(toolTextRect.left + 3, toolTextRect.bottom - 6);
|
||||
|
||||
surface->SetApplicationFont(9, PortabilityLayer::FontFamilyFlag_Bold);
|
||||
ColorText(surface, textPoint, theString, 171L);
|
||||
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(9, PortabilityLayer::FontFamilyFlag_Bold, true);
|
||||
ColorText(surface, textPoint, theString, 171L, appFont);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -182,7 +180,7 @@ void DrawToolTiles (DrawSurface *surface)
|
||||
QOffsetRect(&destRect, toolRects[i + 1].left + 2, toolRects[i + 1].top + 2);
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(toolSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(toolsWindow)),
|
||||
GetPortBitMapForCopyBits(toolsWindow->GetDrawSurface()),
|
||||
&srcRect, &destRect, srcCopy);
|
||||
}
|
||||
}
|
||||
@@ -200,7 +198,7 @@ void EraseSelectedTool (void)
|
||||
if (toolsWindow == nil)
|
||||
return;
|
||||
|
||||
SetPort(&toolsWindow->GetDrawSurface()->m_port);
|
||||
SetPort(toolsWindow->GetDrawSurface());
|
||||
|
||||
toolIcon = toolSelected;
|
||||
if ((toolMode == kBlowerMode) && (toolIcon >= 7))
|
||||
@@ -216,10 +214,11 @@ void EraseSelectedTool (void)
|
||||
}
|
||||
|
||||
theRect = toolRects[toolIcon];
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FrameRect(theRect);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
surface->FrameRect(theRect, whiteColor);
|
||||
InsetRect(&theRect, 1, 1);
|
||||
surface->FrameRect(theRect);
|
||||
surface->FrameRect(theRect, whiteColor);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -250,11 +249,12 @@ void SelectTool (short which)
|
||||
}
|
||||
|
||||
theRect = toolRects[toolIcon];
|
||||
surface->SetForeColor(StdColors::Red());
|
||||
|
||||
surface->FrameRect(theRect);
|
||||
PortabilityLayer::ResolveCachingColor redColor = StdColors::Red();
|
||||
|
||||
surface->FrameRect(theRect, redColor);
|
||||
InsetRect(&theRect, 1, 1);
|
||||
surface->FrameRect(theRect);
|
||||
surface->FrameRect(theRect, redColor);
|
||||
|
||||
toolSelected = which;
|
||||
DrawToolName(surface);
|
||||
@@ -271,9 +271,8 @@ void UpdateToolsWindow (void)
|
||||
|
||||
DrawSurface *surface = toolsWindow->GetDrawSurface();
|
||||
|
||||
DkGrayForeColor(surface);
|
||||
surface->DrawLine(Point::Create(4, 25), Point::Create(112, 25));
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
PortabilityLayer::ResolveCachingColor lineColor = DkGrayForeColor();
|
||||
surface->DrawLine(Point::Create(4, 25), Point::Create(112, 25), lineColor);
|
||||
|
||||
DrawToolTiles(surface);
|
||||
FrameSelectedTool(surface);
|
||||
@@ -330,7 +329,7 @@ void OpenToolsWindow (void)
|
||||
state.m_resID = 141;
|
||||
state.m_window = toolsWindow;
|
||||
|
||||
classPopUp = PortabilityLayer::PopupMenuWidget::Create(state);
|
||||
classPopUp = PortabilityLayer::PopupMenuWidget::Create(state, nullptr);
|
||||
}
|
||||
|
||||
toolsWindow->DrawControls();
|
||||
@@ -472,7 +471,7 @@ void HandleToolsClick (Point wherePt)
|
||||
return;
|
||||
|
||||
SetPortWindowPort(toolsWindow);
|
||||
wherePt -= toolsWindow->TopLeftCoord();
|
||||
wherePt -= toolsWindow->GetTopLeftCoord();
|
||||
|
||||
part = FindControl(wherePt, toolsWindow, &theControl);
|
||||
if ((theControl != nil) && (part != 0))
|
||||
|
||||
@@ -57,7 +57,7 @@ void PourScreenOn (Rect *theRect)
|
||||
columnRects[i].bottom = theRect->bottom;
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
|
||||
&columnRects[i], &columnRects[i], srcCopy);
|
||||
|
||||
QOffsetRect(&columnRects[i], 0, kChipHigh);
|
||||
@@ -115,7 +115,7 @@ void WipeScreenOn (short direction, Rect *theRect)
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
|
||||
&wipeRect, &wipeRect, srcCopy);
|
||||
|
||||
QOffsetRect(&wipeRect, hOffset, vOffset);
|
||||
@@ -135,7 +135,7 @@ void WipeScreenOn (short direction, Rect *theRect)
|
||||
|
||||
void DumpScreenOn (Rect *theRect)
|
||||
{
|
||||
DrawSurface *graf = GetWindowPort(mainWindow);
|
||||
DrawSurface *graf = mainWindow->GetDrawSurface();
|
||||
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(graf),
|
||||
|
||||
@@ -424,7 +424,7 @@ Boolean WaitForInputEvent (short seconds)
|
||||
Boolean waiting, didResume;
|
||||
|
||||
timeToBail = TickCount() + 60L * (long)seconds;
|
||||
FlushEvents(everyEvent, 0);
|
||||
FlushEvents();
|
||||
waiting = true;
|
||||
didResume = false;
|
||||
|
||||
@@ -446,7 +446,7 @@ Boolean WaitForInputEvent (short seconds)
|
||||
|
||||
Delay(1, nullptr);
|
||||
}
|
||||
FlushEvents(everyEvent, 0);
|
||||
FlushEvents();
|
||||
return (didResume);
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ void WaitCommandQReleased (void)
|
||||
|
||||
Delay(1, nullptr);
|
||||
}
|
||||
FlushEvents(everyEvent, 0);
|
||||
FlushEvents();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- KeyMapOffsetFromRawKey
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
#include "PLPasStr.h"
|
||||
#include "Externs.h"
|
||||
#include "Environ.h"
|
||||
#include "FontFamily.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "RectUtils.h"
|
||||
#include "ResolveCachingColor.h"
|
||||
#include "WindowDef.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
@@ -18,6 +20,7 @@
|
||||
|
||||
|
||||
WindowPtr mssgWindow;
|
||||
WindowPtr mssgWindowExclusiveStack;
|
||||
|
||||
|
||||
//============================================================== Functions
|
||||
@@ -35,8 +38,9 @@ void GetWindowLeftTop (WindowPtr theWindow, short *left, short *top)
|
||||
}
|
||||
else
|
||||
{
|
||||
*left = static_cast<short>(theWindow->m_wmX);
|
||||
*top = static_cast<short>(theWindow->m_wmY);
|
||||
const Point windowPos = theWindow->GetTopLeftCoord();
|
||||
*left = windowPos.h;
|
||||
*top = windowPos.v;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +54,7 @@ void GetWindowRect (WindowPtr theWindow, Rect *bounds)
|
||||
{
|
||||
Point upperLeft;
|
||||
GetWindowLeftTop(theWindow, &upperLeft.h, &upperLeft.v);
|
||||
*bounds = theWindow->m_surface.m_port.GetRect() + upperLeft;
|
||||
*bounds = theWindow->GetSurfaceRect() + upperLeft;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,13 +126,14 @@ void OpenMessageWindow (const PLPasStr &title)
|
||||
ShowWindow(mssgWindow);
|
||||
|
||||
DrawSurface *surface = mssgWindow->GetDrawSurface();
|
||||
|
||||
surface->SetClipRect(mssgWindowRect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->SetBackColor(StdColors::White());
|
||||
|
||||
surface->SetSystemFont(12, 0);
|
||||
}
|
||||
|
||||
mssgWindowExclusiveStack = mssgWindow;
|
||||
|
||||
wm->SwapExclusiveWindow(mssgWindowExclusiveStack); // Push exclusive window
|
||||
|
||||
if (doZooms)
|
||||
wm->FlickerWindowIn(mssgWindow, 32);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- SetMessageWindowMessage
|
||||
@@ -136,7 +141,7 @@ void OpenMessageWindow (const PLPasStr &title)
|
||||
// For the above message window, this function displays a string of textÉ
|
||||
// in the center of the window.
|
||||
|
||||
void SetMessageWindowMessage (StringPtr message)
|
||||
void SetMessageWindowMessage (StringPtr message, const PortabilityLayer::RGBAColor &color)
|
||||
{
|
||||
Rect mssgWindowRect;
|
||||
|
||||
@@ -144,14 +149,18 @@ void SetMessageWindowMessage (StringPtr message)
|
||||
{
|
||||
DrawSurface *surface = mssgWindow->GetDrawSurface();
|
||||
|
||||
PortabilityLayer::RenderedFont *sysFont = GetSystemFont(12, PortabilityLayer::FontFamilyFlag_None, true);
|
||||
|
||||
SetRect(&mssgWindowRect, 0, 0, 256, kMessageWindowTall);
|
||||
InsetRect(&mssgWindowRect, 16, 16);
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(mssgWindowRect);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor whiteColor = StdColors::White();
|
||||
surface->FillRect(mssgWindowRect, whiteColor);
|
||||
|
||||
const Point textPoint = Point::Create(mssgWindowRect.left, mssgWindowRect.bottom - 6);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->DrawString(textPoint, message, true);
|
||||
|
||||
PortabilityLayer::ResolveCachingColor specifiedColor = color;
|
||||
surface->DrawString(textPoint, message, specifiedColor, sysFont);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,6 +170,16 @@ void SetMessageWindowMessage (StringPtr message)
|
||||
|
||||
void CloseMessageWindow (void)
|
||||
{
|
||||
PortabilityLayer::WindowManager *wm = PortabilityLayer::WindowManager::GetInstance();
|
||||
|
||||
if (doZooms)
|
||||
wm->FlickerWindowOut(mssgWindow, 32);
|
||||
|
||||
wm->SwapExclusiveWindow(mssgWindowExclusiveStack); // Pop exclusive window
|
||||
assert(mssgWindowExclusiveStack == mssgWindow);
|
||||
|
||||
mssgWindowExclusiveStack = nullptr;
|
||||
|
||||
CloseThisWindow(&mssgWindow);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,30 @@
|
||||
#include "GpAudioChannelXAudio2.h"
|
||||
#include "GpAudioDriverXAudio2.h"
|
||||
#include "IGpAudioChannelCallbacks.h"
|
||||
#include "IGpLogDriver.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <new>
|
||||
|
||||
GpAudioChannelXAudio2 *GpAudioChannelXAudio2::Create(GpAudioDriverXAudio2 *driver)
|
||||
{
|
||||
IGpLogDriver *logger = driver->GetProperties().m_logger;
|
||||
|
||||
void *storage = malloc(sizeof(GpAudioChannelXAudio2));
|
||||
if (!storage)
|
||||
{
|
||||
if (!logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpAudioChannelXAudio2::Create failed, malloc failed");
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GpAudioChannelXAudio2 *channel = new (storage) GpAudioChannelXAudio2(driver);
|
||||
if (!channel->Init())
|
||||
{
|
||||
if (!logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpAudioChannelXAudio2::Init failed");
|
||||
|
||||
channel->Destroy();
|
||||
return nullptr;
|
||||
}
|
||||
@@ -23,6 +34,8 @@ GpAudioChannelXAudio2 *GpAudioChannelXAudio2::Create(GpAudioDriverXAudio2 *drive
|
||||
|
||||
bool GpAudioChannelXAudio2::Init()
|
||||
{
|
||||
IGpLogDriver *logger = m_driver->GetProperties().m_logger;
|
||||
|
||||
const unsigned int sampleRate = m_driver->GetRealSampleRate();
|
||||
IXAudio2 *const xa2 = m_driver->GetXA2();
|
||||
|
||||
@@ -49,7 +62,12 @@ bool GpAudioChannelXAudio2::Init()
|
||||
|
||||
HRESULT hr = xa2->CreateSourceVoice(&m_sourceVoice, &format, XAUDIO2_VOICE_NOPITCH | XAUDIO2_VOICE_NOSRC, 1.0f, &m_xAudioCallbacks, nullptr, nullptr);
|
||||
if (hr != S_OK)
|
||||
{
|
||||
if (!logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "CreateSourceVoice failed with code %lx", hr);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "GpAudioDriverXAudio2.h"
|
||||
|
||||
#include "IGpLogDriver.h"
|
||||
#include "GpAudioChannelXAudio2.h"
|
||||
|
||||
#include <xaudio2.h>
|
||||
@@ -31,34 +32,62 @@ unsigned int GpAudioDriverXAudio2::GetRealSampleRate() const
|
||||
|
||||
GpAudioDriverXAudio2 *GpAudioDriverXAudio2::Create(const GpAudioDriverProperties &properties)
|
||||
{
|
||||
IGpLogDriver *logger = properties.m_logger;
|
||||
|
||||
IXAudio2 *xa = nullptr;
|
||||
IXAudio2MasteringVoice *mv = nullptr;
|
||||
|
||||
const unsigned int realSampleRate = (properties.m_sampleRate + 50) / XAUDIO2_QUANTUM_DENOMINATOR * XAUDIO2_QUANTUM_DENOMINATOR;
|
||||
|
||||
if (CoInitializeEx(nullptr, COINIT_MULTITHREADED) != S_OK)
|
||||
if (logger)
|
||||
{
|
||||
logger->Printf(IGpLogDriver::Category_Information, "XAudio2 Driver starting");
|
||||
logger->Printf(IGpLogDriver::Category_Information, "Real sample rate: %u", realSampleRate);
|
||||
}
|
||||
|
||||
HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "CoInitializeEx failed with code %lx", result);
|
||||
|
||||
CoUninitialize();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UINT flags = 0;
|
||||
if (properties.m_debug)
|
||||
flags |= XAUDIO2_DEBUG_ENGINE;
|
||||
|
||||
if (FAILED(XAudio2Create(&xa, flags, XAUDIO2_DEFAULT_PROCESSOR)))
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "Starting XAudio in debug mode");
|
||||
|
||||
flags |= XAUDIO2_DEBUG_ENGINE;
|
||||
}
|
||||
|
||||
result = XAudio2Create(&xa, flags, XAUDIO2_DEFAULT_PROCESSOR);
|
||||
if (FAILED(result))
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "XAudio2Create failed with code %lx", result);
|
||||
|
||||
CoUninitialize();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (FAILED(xa->CreateMasteringVoice(&mv, 2, realSampleRate, 0, nullptr, nullptr, AudioCategory_GameEffects)))
|
||||
result = xa->CreateMasteringVoice(&mv, 2, realSampleRate, 0, nullptr, nullptr, AudioCategory_GameEffects);
|
||||
if (FAILED(result))
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "CreateMasteringVoice failed with code %lx", result);
|
||||
|
||||
CoUninitialize();
|
||||
xa->Release();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "XAudio2 started OK", result);
|
||||
|
||||
return new GpAudioDriverXAudio2(properties, realSampleRate, xa, mv);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
<Import Project="..\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" />
|
||||
@@ -71,6 +72,7 @@
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
<Import Project="..\Release.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
@@ -130,7 +132,17 @@
|
||||
<ClCompile Include="GpAudioDriverFactoryXAudio2.cpp" />
|
||||
<ClCompile Include="GpAudioDriverXAudio2.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\packages\Microsoft.XAudio2.Redist.1.2.1\build\native\Microsoft.XAudio2.Redist.targets" Condition="Exists('..\packages\Microsoft.XAudio2.Redist.1.2.1\build\native\Microsoft.XAudio2.Redist.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.XAudio2.Redist.1.2.1\build\native\Microsoft.XAudio2.Redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.XAudio2.Redist.1.2.1\build\native\Microsoft.XAudio2.Redist.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -42,4 +42,7 @@
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
4
GpAudioDriver_XAudio2/packages.config
Normal file
4
GpAudioDriver_XAudio2/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.XAudio2.Redist" version="1.2.1" targetFramework="native" />
|
||||
</packages>
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
namespace EGpStandardCursors
|
||||
{
|
||||
{
|
||||
enum EGpStandardCursor
|
||||
{
|
||||
kArrow,
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "EGpAudioDriverType.h"
|
||||
|
||||
struct IGpAudioDriver;
|
||||
struct IGpLogDriver;
|
||||
|
||||
struct GpAudioDriverProperties
|
||||
{
|
||||
@@ -10,4 +11,6 @@ struct GpAudioDriverProperties
|
||||
|
||||
unsigned int m_sampleRate;
|
||||
bool m_debug;
|
||||
|
||||
IGpLogDriver *m_logger;
|
||||
};
|
||||
|
||||
9
GpCommon/GpBuildVersion.h
Normal file
9
GpCommon/GpBuildVersion.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#define GP_BUILD_VERSION_MAJOR 1
|
||||
#define GP_BUILD_VERSION_MINOR 0
|
||||
#define GP_BUILD_VERSION_UPDATE 1
|
||||
|
||||
#define GP_APPLICATION_VERSION_STRING "1.0.1"
|
||||
#define GP_APPLICATION_COPYRIGHT_STRING "2020 Eric Lasota"
|
||||
#define GP_APPLICATION_WEBSITE_STRING "https://github.com/elasota/Aerofoil"
|
||||
@@ -8,6 +8,7 @@
|
||||
struct IGpDisplayDriver;
|
||||
struct IGpFiber;
|
||||
struct IGpVOSEventQueue;
|
||||
struct IGpLogDriver;
|
||||
|
||||
struct GpDisplayDriverProperties
|
||||
{
|
||||
@@ -39,4 +40,5 @@ struct GpDisplayDriverProperties
|
||||
void *m_adjustRequestedResolutionFuncContext;
|
||||
|
||||
IGpVOSEventQueue *m_eventQueue;
|
||||
IGpLogDriver *m_logger;
|
||||
};
|
||||
|
||||
@@ -19,9 +19,13 @@ struct GpWindowsGlobals
|
||||
{
|
||||
HINSTANCE m_hInstance;
|
||||
HINSTANCE m_hPrevInstance;
|
||||
LPCSTR m_cmdLine;
|
||||
LPCWSTR m_cmdLine;
|
||||
int m_cmdLineArgc;
|
||||
LPWSTR *m_cmdLineArgv;
|
||||
LPCWSTR m_baseDir;
|
||||
HWND m_hwnd;
|
||||
HICON m_hIcon;
|
||||
HICON m_hIconSm;
|
||||
int m_nCmdShow;
|
||||
|
||||
IGpFiber *(*m_createFiberFunc)(LPVOID fiber);
|
||||
|
||||
@@ -6,6 +6,19 @@
|
||||
struct IGpDisplayDriverSurface;
|
||||
struct IGpCursor;
|
||||
|
||||
struct GpDisplayDriverSurfaceEffects
|
||||
{
|
||||
GpDisplayDriverSurfaceEffects();
|
||||
|
||||
bool m_darken;
|
||||
bool m_flicker;
|
||||
int32_t m_flickerAxisX;
|
||||
int32_t m_flickerAxisY;
|
||||
int32_t m_flickerStartThreshold;
|
||||
int32_t m_flickerEndThreshold;
|
||||
float m_desaturation;
|
||||
};
|
||||
|
||||
// Display drivers are responsible for timing and calling the game tick function.
|
||||
struct IGpDisplayDriver
|
||||
{
|
||||
@@ -16,7 +29,7 @@ public:
|
||||
virtual void GetDisplayResolution(unsigned int *width, unsigned int *height, GpPixelFormat_t *bpp) = 0;
|
||||
|
||||
virtual IGpDisplayDriverSurface *CreateSurface(size_t width, size_t height, GpPixelFormat_t pixelFormat) = 0;
|
||||
virtual void DrawSurface(IGpDisplayDriverSurface *surface, int32_t x, int32_t y, size_t width, size_t height) = 0;
|
||||
virtual void DrawSurface(IGpDisplayDriverSurface *surface, int32_t x, int32_t y, size_t width, size_t height, const GpDisplayDriverSurfaceEffects *effects) = 0;
|
||||
|
||||
virtual IGpCursor *LoadCursor(bool isColor, int cursorID) = 0;
|
||||
virtual void SetCursor(IGpCursor *cursor) = 0;
|
||||
@@ -28,3 +41,14 @@ public:
|
||||
|
||||
virtual void RequestToggleFullScreen(uint32_t timestamp) = 0;
|
||||
};
|
||||
|
||||
inline GpDisplayDriverSurfaceEffects::GpDisplayDriverSurfaceEffects()
|
||||
: m_darken(false)
|
||||
, m_flicker(false)
|
||||
, m_flickerAxisX(0)
|
||||
, m_flickerAxisY(0)
|
||||
, m_flickerStartThreshold(0)
|
||||
, m_flickerEndThreshold(0)
|
||||
, m_desaturation(0)
|
||||
{
|
||||
}
|
||||
|
||||
28
GpCommon/IGpLogDriver.h
Normal file
28
GpCommon/IGpLogDriver.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdarg>
|
||||
#include <stdio.h>
|
||||
|
||||
struct IGpLogDriver
|
||||
{
|
||||
enum Category
|
||||
{
|
||||
Category_Information,
|
||||
Category_Warning,
|
||||
Category_Error,
|
||||
};
|
||||
|
||||
virtual void VPrintf(Category category, const char *fmt, va_list args) = 0;
|
||||
virtual void Shutdown() = 0;
|
||||
|
||||
void Printf(Category category, const char *fmt, ...);
|
||||
};
|
||||
|
||||
|
||||
inline void IGpLogDriver::Printf(Category category, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
this->VPrintf(category, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
@@ -1,55 +1,140 @@
|
||||
static unsigned char gs_shaderData[] = {
|
||||
68, 88, 66, 67, 96, 46, 192, 91, 73, 216, 92, 145, 77, 166, 215,
|
||||
215, 59, 255, 4, 67, 1, 0, 0, 0, 240, 2, 0, 0, 5, 0,
|
||||
0, 0, 52, 0, 0, 0, 224, 0, 0, 0, 56, 1, 0, 0, 108,
|
||||
1, 0, 0, 116, 2, 0, 0, 82, 68, 69, 70, 164, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0,
|
||||
0, 0, 4, 255, 255, 0, 137, 0, 0, 122, 0, 0, 0, 92, 0,
|
||||
68, 88, 66, 67, 22, 132, 178, 62, 124, 31, 180, 122, 2, 1, 47,
|
||||
236, 0, 128, 56, 7, 1, 0, 0, 0, 240, 7, 0, 0, 5, 0,
|
||||
0, 0, 52, 0, 0, 0, 172, 2, 0, 0, 4, 3, 0, 0, 56,
|
||||
3, 0, 0, 116, 7, 0, 0, 82, 68, 69, 70, 112, 2, 0, 0,
|
||||
1, 0, 0, 0, 180, 0, 0, 0, 3, 0, 0, 0, 28, 0, 0,
|
||||
0, 0, 4, 255, 255, 0, 137, 0, 0, 72, 2, 0, 0, 124, 0,
|
||||
0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 255,
|
||||
255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
|
||||
107, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 2, 0, 0,
|
||||
139, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 2, 0, 0,
|
||||
0, 255, 255, 255, 255, 1, 0, 0, 0, 1, 0, 0, 0, 13, 0,
|
||||
0, 0, 115, 117, 114, 102, 97, 99, 101, 84, 101, 120, 116, 117, 114,
|
||||
101, 0, 112, 97, 108, 101, 116, 116, 101, 84, 101, 120, 116, 117, 114,
|
||||
101, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41,
|
||||
32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
|
||||
109, 112, 105, 108, 101, 114, 32, 49, 48, 46, 49, 0, 171, 171, 73,
|
||||
83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0,
|
||||
56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0,
|
||||
0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3,
|
||||
3, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
|
||||
84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171, 79, 83, 71,
|
||||
78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
|
||||
0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69,
|
||||
84, 0, 171, 171, 83, 72, 68, 82, 0, 1, 0, 0, 64, 0, 0,
|
||||
0, 64, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, 0, 0,
|
||||
0, 0, 68, 68, 0, 0, 88, 16, 0, 4, 0, 112, 16, 0, 1,
|
||||
0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0,
|
||||
1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0,
|
||||
0, 104, 0, 0, 2, 1, 0, 0, 0, 27, 0, 0, 5, 50, 0,
|
||||
16, 0, 0, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 54,
|
||||
0, 0, 8, 194, 0, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0,
|
||||
0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
|
||||
1, 0, 0, 0, 115, 117, 114, 102, 97, 99, 101, 84, 101, 120, 116,
|
||||
117, 114, 101, 0, 112, 97, 108, 101, 116, 116, 101, 84, 101, 120, 116,
|
||||
117, 114, 101, 0, 83, 68, 114, 97, 119, 81, 117, 97, 100, 80, 105,
|
||||
120, 101, 108, 67, 111, 110, 115, 116, 97, 110, 116, 115, 0, 171, 171,
|
||||
154, 0, 0, 0, 6, 0, 0, 0, 204, 0, 0, 0, 48, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 1, 0, 0, 0, 0,
|
||||
0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 116, 1, 0, 0, 0,
|
||||
0, 0, 0, 132, 1, 0, 0, 16, 0, 0, 0, 8, 0, 0, 0,
|
||||
2, 0, 0, 0, 156, 1, 0, 0, 0, 0, 0, 0, 172, 1, 0,
|
||||
0, 24, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 204, 1,
|
||||
0, 0, 0, 0, 0, 0, 220, 1, 0, 0, 28, 0, 0, 0, 4,
|
||||
0, 0, 0, 2, 0, 0, 0, 204, 1, 0, 0, 0, 0, 0, 0,
|
||||
250, 1, 0, 0, 32, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0,
|
||||
0, 20, 2, 0, 0, 0, 0, 0, 0, 36, 2, 0, 0, 36, 0,
|
||||
0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 56, 2, 0, 0, 0,
|
||||
0, 0, 0, 99, 111, 110, 115, 116, 97, 110, 116, 115, 95, 77, 111,
|
||||
100, 117, 108, 97, 116, 105, 111, 110, 0, 171, 171, 171, 1, 0, 3,
|
||||
0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 111,
|
||||
110, 115, 116, 97, 110, 116, 115, 95, 70, 108, 105, 99, 107, 101, 114,
|
||||
65, 120, 105, 115, 0, 171, 171, 1, 0, 2, 0, 1, 0, 2, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 99, 111, 110, 115, 116, 97, 110,
|
||||
116, 115, 95, 70, 108, 105, 99, 107, 101, 114, 83, 116, 97, 114, 116,
|
||||
84, 104, 114, 101, 115, 104, 111, 108, 100, 0, 0, 0, 2, 0, 1,
|
||||
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 111, 110, 115,
|
||||
116, 97, 110, 116, 115, 95, 70, 108, 105, 99, 107, 101, 114, 69, 110,
|
||||
100, 84, 104, 114, 101, 115, 104, 111, 108, 100, 0, 99, 111, 110, 115,
|
||||
116, 97, 110, 116, 115, 95, 68, 101, 115, 97, 116, 117, 114, 97, 116,
|
||||
105, 111, 110, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0, 1, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 99, 111, 110, 115, 116, 97, 110,
|
||||
116, 115, 95, 85, 110, 117, 115, 101, 100, 0, 171, 171, 171, 1, 0,
|
||||
3, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77,
|
||||
105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76,
|
||||
83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105,
|
||||
108, 101, 114, 32, 49, 48, 46, 49, 0, 73, 83, 71, 78, 80, 0,
|
||||
0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0,
|
||||
0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
|
||||
15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86,
|
||||
95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79,
|
||||
79, 82, 68, 0, 171, 171, 171, 79, 83, 71, 78, 44, 0, 0, 0,
|
||||
1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0,
|
||||
0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83,
|
||||
72, 68, 82, 52, 4, 0, 0, 64, 0, 0, 0, 13, 1, 0, 0,
|
||||
89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 3, 0, 0,
|
||||
0, 88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 68, 68,
|
||||
0, 0, 88, 16, 0, 4, 0, 112, 16, 0, 1, 0, 0, 0, 85,
|
||||
85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0,
|
||||
101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0,
|
||||
2, 3, 0, 0, 0, 65, 0, 0, 5, 50, 0, 16, 0, 0, 0,
|
||||
0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 27, 0, 0, 5, 50,
|
||||
0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0,
|
||||
54, 0, 0, 8, 194, 0, 16, 0, 0, 0, 0, 0, 2, 64, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 45, 0, 0, 7, 242, 0, 16, 0, 0, 0, 0, 0, 70, 14,
|
||||
16, 0, 0, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 54,
|
||||
0, 0, 8, 226, 0, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0,
|
||||
0, 0, 45, 0, 0, 7, 242, 0, 16, 0, 1, 0, 0, 0, 70,
|
||||
14, 16, 0, 0, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0,
|
||||
54, 0, 0, 8, 226, 0, 16, 0, 1, 0, 0, 0, 2, 64, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 45, 0, 0, 7, 242, 0, 16, 0, 0, 0, 0, 0, 70, 14,
|
||||
16, 0, 0, 0, 0, 0, 70, 126, 16, 0, 1, 0, 0, 0, 54,
|
||||
0, 0, 5, 114, 32, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0,
|
||||
0, 0, 0, 0, 54, 0, 0, 5, 130, 32, 16, 0, 0, 0, 0,
|
||||
0, 1, 64, 0, 0, 0, 0, 128, 63, 62, 0, 0, 1, 83, 84,
|
||||
65, 84, 116, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 0,
|
||||
0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 45, 0, 0, 7, 242, 0, 16, 0, 1, 0, 0, 0, 70,
|
||||
14, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, 1, 0, 0, 0,
|
||||
56, 0, 0, 9, 242, 0, 16, 0, 2, 0, 0, 0, 70, 142, 32,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 130, 0, 16, 0, 1,
|
||||
0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, 56, 0, 0, 7,
|
||||
242, 0, 16, 0, 1, 0, 0, 0, 70, 14, 16, 0, 1, 0, 0,
|
||||
0, 70, 14, 16, 0, 2, 0, 0, 0, 38, 0, 0, 9, 0, 208,
|
||||
0, 0, 50, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0,
|
||||
0, 0, 0, 70, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0,
|
||||
30, 0, 0, 7, 18, 0, 16, 0, 0, 0, 0, 0, 26, 0, 16,
|
||||
0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 34, 0,
|
||||
0, 8, 34, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0,
|
||||
0, 0, 0, 42, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0,
|
||||
33, 0, 0, 8, 18, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16,
|
||||
0, 0, 0, 0, 0, 58, 128, 32, 0, 0, 0, 0, 0, 1, 0,
|
||||
0, 0, 55, 0, 0, 12, 242, 0, 16, 0, 1, 0, 0, 0, 86,
|
||||
5, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 14, 16,
|
||||
0, 1, 0, 0, 0, 60, 0, 0, 7, 18, 0, 16, 0, 0, 0,
|
||||
0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 26, 0, 16, 0, 0,
|
||||
0, 0, 0, 55, 0, 0, 12, 242, 0, 16, 0, 0, 0, 0, 0,
|
||||
6, 0, 16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 1, 0, 0,
|
||||
0, 2, 64, 0, 0, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0,
|
||||
128, 63, 0, 0, 128, 63, 29, 0, 0, 7, 18, 0, 16, 0, 1,
|
||||
0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 58, 0, 16, 0,
|
||||
0, 0, 0, 0, 13, 0, 4, 3, 10, 0, 16, 0, 1, 0, 0,
|
||||
0, 57, 0, 0, 8, 18, 0, 16, 0, 1, 0, 0, 0, 10, 128,
|
||||
32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 64, 0, 0, 0,
|
||||
0, 0, 0, 16, 0, 0, 10, 34, 0, 16, 0, 1, 0, 0, 0,
|
||||
70, 2, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 154, 153, 153,
|
||||
62, 154, 153, 25, 63, 205, 204, 204, 61, 0, 0, 0, 0, 0, 0,
|
||||
0, 9, 66, 0, 16, 0, 1, 0, 0, 0, 10, 128, 32, 128, 65,
|
||||
0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 64, 0, 0,
|
||||
0, 0, 128, 63, 56, 0, 0, 8, 34, 0, 16, 0, 1, 0, 0,
|
||||
0, 26, 0, 16, 0, 1, 0, 0, 0, 10, 128, 32, 0, 0, 0,
|
||||
0, 0, 2, 0, 0, 0, 50, 0, 0, 9, 226, 0, 16, 0, 1,
|
||||
0, 0, 0, 6, 9, 16, 0, 0, 0, 0, 0, 166, 10, 16, 0,
|
||||
1, 0, 0, 0, 86, 5, 16, 0, 1, 0, 0, 0, 55, 32, 0,
|
||||
9, 114, 0, 16, 0, 0, 0, 0, 0, 6, 0, 16, 0, 1, 0,
|
||||
0, 0, 150, 7, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0,
|
||||
0, 0, 0, 47, 0, 0, 5, 114, 0, 16, 0, 0, 0, 0, 0,
|
||||
70, 2, 16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16,
|
||||
0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 2, 64,
|
||||
0, 0, 102, 102, 230, 63, 102, 102, 230, 63, 102, 102, 230, 63, 0,
|
||||
0, 0, 0, 25, 0, 0, 5, 114, 0, 16, 0, 0, 0, 0, 0,
|
||||
70, 2, 16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16,
|
||||
0, 1, 0, 0, 0, 86, 5, 16, 0, 0, 0, 0, 0, 2, 64,
|
||||
0, 0, 150, 246, 160, 189, 43, 199, 117, 63, 40, 177, 243, 60, 0,
|
||||
0, 0, 0, 50, 0, 0, 12, 114, 0, 16, 0, 1, 0, 0, 0,
|
||||
6, 0, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 87, 203, 136,
|
||||
63, 86, 131, 197, 60, 225, 104, 227, 58, 0, 0, 0, 0, 70, 2,
|
||||
16, 0, 1, 0, 0, 0, 50, 0, 0, 12, 114, 32, 16, 0, 0,
|
||||
0, 0, 0, 166, 10, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0,
|
||||
5, 9, 34, 60, 158, 151, 129, 60, 194, 240, 119, 63, 0, 0, 0,
|
||||
0, 70, 2, 16, 0, 1, 0, 0, 0, 54, 0, 0, 5, 130, 32,
|
||||
16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 62,
|
||||
0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 32, 0, 0, 0,
|
||||
3, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0,
|
||||
0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,
|
||||
0, 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
namespace GpBinarizedShaders
|
||||
|
||||
@@ -1,49 +1,46 @@
|
||||
static unsigned char gs_shaderData[] = {
|
||||
68, 88, 66, 67, 181, 133, 124, 121, 179, 141, 64, 216, 166, 21, 153,
|
||||
10, 33, 21, 80, 169, 1, 0, 0, 0, 152, 2, 0, 0, 5, 0,
|
||||
0, 0, 52, 0, 0, 0, 224, 0, 0, 0, 56, 1, 0, 0, 108,
|
||||
1, 0, 0, 28, 2, 0, 0, 82, 68, 69, 70, 164, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0,
|
||||
0, 0, 4, 255, 255, 0, 137, 0, 0, 122, 0, 0, 0, 92, 0,
|
||||
0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
|
||||
107, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0,
|
||||
0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
|
||||
0, 0, 115, 117, 114, 102, 97, 99, 101, 83, 97, 109, 112, 108, 101,
|
||||
114, 0, 115, 117, 114, 102, 97, 99, 101, 84, 101, 120, 116, 117, 114,
|
||||
101, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41,
|
||||
32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
|
||||
109, 112, 105, 108, 101, 114, 32, 49, 48, 46, 49, 0, 171, 171, 73,
|
||||
83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0,
|
||||
56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0,
|
||||
0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3,
|
||||
3, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
|
||||
84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171, 79, 83, 71,
|
||||
78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
|
||||
0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69,
|
||||
84, 0, 171, 171, 83, 72, 68, 82, 168, 0, 0, 0, 64, 0, 0,
|
||||
0, 42, 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 0, 0,
|
||||
68, 88, 66, 67, 196, 70, 6, 103, 19, 68, 64, 241, 205, 255, 73,
|
||||
188, 120, 217, 29, 231, 1, 0, 0, 0, 116, 2, 0, 0, 5, 0,
|
||||
0, 0, 52, 0, 0, 0, 176, 0, 0, 0, 8, 1, 0, 0, 60,
|
||||
1, 0, 0, 248, 1, 0, 0, 82, 68, 69, 70, 116, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0,
|
||||
0, 0, 4, 255, 255, 0, 137, 0, 0, 75, 0, 0, 0, 60, 0,
|
||||
0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255,
|
||||
255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 9, 0, 0, 0,
|
||||
115, 117, 114, 102, 97, 99, 101, 84, 101, 120, 116, 117, 114, 101, 0,
|
||||
77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72,
|
||||
76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112,
|
||||
105, 108, 101, 114, 32, 49, 48, 46, 49, 0, 171, 73, 83, 71, 78,
|
||||
80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0,
|
||||
0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0,
|
||||
0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0,
|
||||
83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88,
|
||||
67, 79, 79, 82, 68, 0, 171, 171, 171, 79, 83, 71, 78, 44, 0,
|
||||
0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
|
||||
15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171,
|
||||
171, 83, 72, 68, 82, 180, 0, 0, 0, 64, 0, 0, 0, 45, 0,
|
||||
0, 0, 88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85,
|
||||
85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0,
|
||||
101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0,
|
||||
2, 1, 0, 0, 0, 69, 0, 0, 9, 242, 0, 16, 0, 0, 0,
|
||||
0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, 0,
|
||||
0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 54, 0, 0, 5,
|
||||
18, 32, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0,
|
||||
0, 54, 0, 0, 5, 98, 32, 16, 0, 0, 0, 0, 0, 6, 17,
|
||||
16, 0, 1, 0, 0, 0, 54, 0, 0, 5, 130, 32, 16, 0, 0,
|
||||
0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, 62, 0, 0, 1,
|
||||
83, 84, 65, 84, 116, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0,
|
||||
0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
2, 1, 0, 0, 0, 27, 0, 0, 5, 50, 0, 16, 0, 0, 0,
|
||||
0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 54, 0, 0, 8, 194,
|
||||
0, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0,
|
||||
7, 242, 0, 16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 0, 0,
|
||||
0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 54, 0, 0, 5, 114,
|
||||
32, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0,
|
||||
54, 0, 0, 5, 130, 32, 16, 0, 0, 0, 0, 0, 1, 64, 0,
|
||||
0, 0, 0, 128, 63, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0,
|
||||
0, 0, 6, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
namespace GpBinarizedShaders
|
||||
|
||||
101
GpDisplayDriver_D3D11/CompiledShaders/ScaleQuadP_D3D11.cpp
Normal file
101
GpDisplayDriver_D3D11/CompiledShaders/ScaleQuadP_D3D11.cpp
Normal file
@@ -0,0 +1,101 @@
|
||||
static unsigned char gs_shaderData[] = {
|
||||
68, 88, 66, 67, 232, 177, 184, 42, 191, 44, 237, 186, 185, 1, 42,
|
||||
67, 157, 207, 200, 70, 1, 0, 0, 0, 116, 5, 0, 0, 5, 0,
|
||||
0, 0, 52, 0, 0, 0, 52, 1, 0, 0, 140, 1, 0, 0, 192,
|
||||
1, 0, 0, 248, 4, 0, 0, 82, 68, 69, 70, 248, 0, 0, 0,
|
||||
1, 0, 0, 0, 132, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0,
|
||||
0, 0, 4, 255, 255, 0, 137, 0, 0, 208, 0, 0, 0, 92, 0,
|
||||
0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255,
|
||||
255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 9, 0, 0, 0,
|
||||
107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
|
||||
0, 0, 115, 117, 114, 102, 97, 99, 101, 84, 101, 120, 116, 117, 114,
|
||||
101, 0, 83, 83, 99, 97, 108, 101, 81, 117, 97, 100, 80, 105, 120,
|
||||
101, 108, 67, 111, 110, 115, 116, 97, 110, 116, 115, 0, 107, 0, 0,
|
||||
0, 1, 0, 0, 0, 156, 0, 0, 0, 16, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 180, 0, 0, 0, 0, 0, 0, 0, 16,
|
||||
0, 0, 0, 2, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 120, 100, 121, 95, 85, 110, 117, 115, 101, 100, 0, 1, 0, 3,
|
||||
0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105,
|
||||
99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83,
|
||||
76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105, 108,
|
||||
101, 114, 32, 49, 48, 46, 49, 0, 73, 83, 71, 78, 80, 0, 0,
|
||||
0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15,
|
||||
0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86, 95,
|
||||
80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79, 79,
|
||||
82, 68, 0, 171, 171, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1,
|
||||
0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0,
|
||||
0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83, 72,
|
||||
68, 82, 48, 3, 0, 0, 64, 0, 0, 0, 204, 0, 0, 0, 89,
|
||||
0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0,
|
||||
88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0,
|
||||
0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 101, 0,
|
||||
0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 5,
|
||||
0, 0, 0, 51, 0, 0, 11, 50, 0, 16, 0, 0, 0, 0, 0,
|
||||
70, 128, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 64, 0,
|
||||
0, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 50, 0, 0, 14, 194, 0, 16, 0, 0, 0, 0, 0, 6,
|
||||
132, 32, 128, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
2, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
63, 0, 0, 0, 63, 6, 20, 16, 0, 1, 0, 0, 0, 52, 0,
|
||||
0, 10, 194, 0, 16, 0, 0, 0, 0, 0, 166, 14, 16, 0, 0,
|
||||
0, 0, 0, 2, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 50, 0, 16,
|
||||
0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 230, 10,
|
||||
16, 0, 0, 0, 0, 0, 65, 0, 0, 5, 194, 0, 16, 0, 0,
|
||||
0, 0, 0, 166, 14, 16, 0, 0, 0, 0, 0, 27, 0, 0, 5,
|
||||
50, 0, 16, 0, 1, 0, 0, 0, 230, 10, 16, 0, 0, 0, 0,
|
||||
0, 65, 0, 0, 5, 194, 0, 16, 0, 0, 0, 0, 0, 6, 4,
|
||||
16, 0, 0, 0, 0, 0, 0, 0, 0, 8, 50, 0, 16, 0, 0,
|
||||
0, 0, 0, 230, 10, 16, 128, 65, 0, 0, 0, 0, 0, 0, 0,
|
||||
70, 0, 16, 0, 0, 0, 0, 0, 27, 0, 0, 5, 50, 0, 16,
|
||||
0, 2, 0, 0, 0, 230, 10, 16, 0, 0, 0, 0, 0, 14, 32,
|
||||
0, 8, 50, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0,
|
||||
0, 0, 0, 70, 128, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
54, 0, 0, 5, 66, 0, 16, 0, 1, 0, 0, 0, 1, 64, 0,
|
||||
0, 0, 0, 0, 0, 54, 0, 0, 5, 194, 0, 16, 0, 2, 0,
|
||||
0, 0, 86, 9, 16, 0, 1, 0, 0, 0, 45, 0, 0, 7, 242,
|
||||
0, 16, 0, 3, 0, 0, 0, 70, 15, 16, 0, 2, 0, 0, 0,
|
||||
70, 126, 16, 0, 0, 0, 0, 0, 45, 0, 0, 7, 242, 0, 16,
|
||||
0, 4, 0, 0, 0, 134, 15, 16, 0, 2, 0, 0, 0, 70, 126,
|
||||
16, 0, 0, 0, 0, 0, 54, 0, 0, 5, 130, 0, 16, 0, 1,
|
||||
0, 0, 0, 26, 0, 16, 0, 2, 0, 0, 0, 45, 0, 0, 7,
|
||||
242, 0, 16, 0, 2, 0, 0, 0, 198, 10, 16, 0, 1, 0, 0,
|
||||
0, 70, 126, 16, 0, 0, 0, 0, 0, 45, 0, 0, 7, 242, 0,
|
||||
16, 0, 1, 0, 0, 0, 70, 10, 16, 0, 1, 0, 0, 0, 70,
|
||||
126, 16, 0, 0, 0, 0, 0, 56, 0, 0, 7, 114, 0, 16, 0,
|
||||
4, 0, 0, 0, 6, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16,
|
||||
0, 4, 0, 0, 0, 56, 0, 0, 7, 114, 0, 16, 0, 3, 0,
|
||||
0, 0, 6, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 3,
|
||||
0, 0, 0, 0, 0, 0, 11, 82, 0, 16, 0, 0, 0, 0, 0,
|
||||
6, 1, 16, 128, 65, 0, 0, 0, 0, 0, 0, 0, 2, 64, 0,
|
||||
0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0,
|
||||
0, 0, 50, 0, 0, 9, 114, 0, 16, 0, 2, 0, 0, 0, 6,
|
||||
0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 2, 0, 0, 0,
|
||||
70, 2, 16, 0, 3, 0, 0, 0, 56, 0, 0, 7, 114, 0, 16,
|
||||
0, 2, 0, 0, 0, 86, 5, 16, 0, 0, 0, 0, 0, 70, 2,
|
||||
16, 0, 2, 0, 0, 0, 50, 0, 0, 9, 178, 0, 16, 0, 0,
|
||||
0, 0, 0, 6, 0, 16, 0, 0, 0, 0, 0, 70, 8, 16, 0,
|
||||
1, 0, 0, 0, 70, 8, 16, 0, 4, 0, 0, 0, 50, 0, 0,
|
||||
9, 114, 32, 16, 0, 0, 0, 0, 0, 166, 10, 16, 0, 0, 0,
|
||||
0, 0, 70, 3, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 2,
|
||||
0, 0, 0, 54, 0, 0, 5, 130, 32, 16, 0, 0, 0, 0, 0,
|
||||
1, 64, 0, 0, 0, 0, 128, 63, 62, 0, 0, 1, 83, 84, 65,
|
||||
84, 116, 0, 0, 0, 26, 0, 0, 0, 5, 0, 0, 0, 0, 0,
|
||||
0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 4,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0,
|
||||
};
|
||||
|
||||
namespace GpBinarizedShaders
|
||||
{
|
||||
const unsigned char *g_scaleQuadP_D3D11[2] = { gs_shaderData, gs_shaderData + sizeof(gs_shaderData) };
|
||||
};
|
||||
@@ -1,4 +1,3 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#include "GpApplicationName.h"
|
||||
#include "GpDisplayDriverD3D11.h"
|
||||
#include "GpDisplayDriverSurfaceD3D11.h"
|
||||
@@ -8,6 +7,8 @@
|
||||
#include "IGpFiber.h"
|
||||
#include "IGpVOSEventQueue.h"
|
||||
|
||||
#include "IGpLogDriver.h"
|
||||
|
||||
#include <d3d11.h>
|
||||
#include <dxgi1_2.h>
|
||||
#include <float.h>
|
||||
@@ -18,11 +19,14 @@
|
||||
|
||||
#pragma comment (lib, "d3d11.lib")
|
||||
|
||||
static GpDisplayDriverSurfaceEffects gs_defaultEffects;
|
||||
|
||||
namespace GpBinarizedShaders
|
||||
{
|
||||
extern const unsigned char *g_drawQuadV_D3D11[2];
|
||||
extern const unsigned char *g_drawQuadPaletteP_D3D11[2];
|
||||
extern const unsigned char *g_drawQuadRGBP_D3D11[2];
|
||||
extern const unsigned char *g_scaleQuadP_D3D11[2];
|
||||
extern const unsigned char *g_drawQuad15BitP_D3D11[2];
|
||||
}
|
||||
|
||||
@@ -123,7 +127,7 @@ bool ResizeSwapChain(IDXGISwapChain1 *swapChain, UINT width, UINT height)
|
||||
return true;
|
||||
}
|
||||
|
||||
void StartD3DForWindow(HWND hWnd, GpComPtr<IDXGISwapChain1>& outSwapChain, GpComPtr<ID3D11Device>& outDevice, GpComPtr<ID3D11DeviceContext>& outContext)
|
||||
void StartD3DForWindow(HWND hWnd, GpComPtr<IDXGISwapChain1>& outSwapChain, GpComPtr<ID3D11Device>& outDevice, GpComPtr<ID3D11DeviceContext>& outContext, IGpLogDriver *logger)
|
||||
{
|
||||
DXGI_SWAP_CHAIN_FULLSCREEN_DESC swapChainFullscreenDesc;
|
||||
|
||||
@@ -151,6 +155,14 @@ void StartD3DForWindow(HWND hWnd, GpComPtr<IDXGISwapChain1>& outSwapChain, GpCom
|
||||
HRESULT result = D3D11CreateDevice(nullptr, D3D_DRIVER_TYPE_HARDWARE, NULL, flags, featureLevels, sizeof(featureLevels) / sizeof(featureLevels[0]),
|
||||
D3D11_SDK_VERSION, &device, &selectedFeatureLevel, &context);
|
||||
|
||||
if (logger)
|
||||
{
|
||||
if (result == S_OK)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "StartD3DForWindow: D3D11CreateDevice succeeded. Selected feature level is %i", static_cast<int>(selectedFeatureLevel));
|
||||
else
|
||||
logger->Printf(IGpLogDriver::Category_Error, "StartD3DForWindow: D3D11CreateDevice failed with code %lx", result);
|
||||
}
|
||||
|
||||
InitSwapChainForWindow(hWnd, device, outSwapChain);
|
||||
|
||||
// GP TODO: Fix the error handling here, it's bad...
|
||||
@@ -158,8 +170,11 @@ void StartD3DForWindow(HWND hWnd, GpComPtr<IDXGISwapChain1>& outSwapChain, GpCom
|
||||
outContext = context;
|
||||
}
|
||||
|
||||
bool ResizeD3DWindow(HWND hWnd, DWORD &windowWidth, DWORD &windowHeight, LONG desiredWidth, LONG desiredHeight, DWORD windowStyle, HMENU menus)
|
||||
bool ResizeD3DWindow(HWND hWnd, DWORD &windowWidth, DWORD &windowHeight, LONG desiredWidth, LONG desiredHeight, DWORD windowStyle, HMENU menus, IGpLogDriver *logger)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "ResizeD3DWindow: %i x %i", static_cast<int>(desiredWidth), static_cast<int>(desiredHeight));
|
||||
|
||||
if (desiredWidth < 640)
|
||||
desiredWidth = 640;
|
||||
else if (desiredWidth > MAXDWORD)
|
||||
@@ -170,6 +185,9 @@ bool ResizeD3DWindow(HWND hWnd, DWORD &windowWidth, DWORD &windowHeight, LONG de
|
||||
else if (desiredHeight > MAXDWORD)
|
||||
desiredHeight = MAXDWORD;
|
||||
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "ResizeD3DWindow: Adjusted dimensions: %i x %i", static_cast<int>(desiredWidth), static_cast<int>(desiredHeight));
|
||||
|
||||
RECT windowRect;
|
||||
GetClientRect(hWnd, &windowRect);
|
||||
windowRect.right = windowRect.left + desiredWidth;
|
||||
@@ -178,9 +196,20 @@ bool ResizeD3DWindow(HWND hWnd, DWORD &windowWidth, DWORD &windowHeight, LONG de
|
||||
LONG_PTR style = GetWindowLongPtrA(hWnd, GWL_STYLE);
|
||||
|
||||
if (!AdjustWindowRect(&windowRect, static_cast<DWORD>(style), menus != nullptr))
|
||||
return false;
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "ResizeD3DWindow: AdjustWindowRect failed");
|
||||
|
||||
SetWindowPos(hWnd, HWND_TOP, windowRect.left, windowRect.top, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, SWP_NOZORDER | SWP_NOMOVE);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!SetWindowPos(hWnd, HWND_TOP, windowRect.left, windowRect.top, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, SWP_NOZORDER | SWP_NOMOVE))
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "ResizeD3DWindow: SetWindowPos failed");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
windowWidth = desiredWidth;
|
||||
windowHeight = desiredHeight;
|
||||
@@ -190,6 +219,11 @@ bool ResizeD3DWindow(HWND hWnd, DWORD &windowWidth, DWORD &windowHeight, LONG de
|
||||
|
||||
bool GpDisplayDriverD3D11::DetachSwapChain()
|
||||
{
|
||||
IGpLogDriver *logger = m_properties.m_logger;
|
||||
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "GpDisplayDriverD3D11::DetachSwapChain");
|
||||
|
||||
m_deviceContext->OMSetRenderTargets(0, nullptr, nullptr);
|
||||
m_backBufferRTV = nullptr;
|
||||
m_backBufferTexture = nullptr;
|
||||
@@ -200,8 +234,13 @@ bool GpDisplayDriverD3D11::DetachSwapChain()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GpDisplayDriverD3D11::InitBackBuffer()
|
||||
bool GpDisplayDriverD3D11::InitBackBuffer(uint32_t virtualWidth, uint32_t virtualHeight)
|
||||
{
|
||||
IGpLogDriver *logger = m_properties.m_logger;
|
||||
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "GpDisplayDriverD3D11::InitBackBuffer");
|
||||
|
||||
m_swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), reinterpret_cast<LPVOID*>(m_backBufferTexture.GetMutablePtr()));
|
||||
|
||||
{
|
||||
@@ -213,16 +252,90 @@ bool GpDisplayDriverD3D11::InitBackBuffer()
|
||||
rtvDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
|
||||
rtvDesc.Texture2D.MipSlice = 0;
|
||||
|
||||
if (m_device->CreateRenderTargetView(m_backBufferTexture, &rtvDesc, m_backBufferRTV.GetMutablePtr()) != S_OK)
|
||||
m_backBufferRTV = nullptr;
|
||||
HRESULT result = m_device->CreateRenderTargetView(m_backBufferTexture, &rtvDesc, m_backBufferRTV.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitBackBuffer: CreateRenderTargetView for back buffer failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DXGI_FORMAT vbbFormat = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
|
||||
|
||||
{
|
||||
D3D11_TEXTURE2D_DESC vbbTextureDesc;
|
||||
vbbTextureDesc.Width = static_cast<UINT>(virtualWidth);
|
||||
vbbTextureDesc.Height = static_cast<UINT>(virtualHeight);
|
||||
vbbTextureDesc.MipLevels = 1;
|
||||
vbbTextureDesc.ArraySize = 1;
|
||||
vbbTextureDesc.Format = vbbFormat;
|
||||
vbbTextureDesc.SampleDesc.Count = 1;
|
||||
vbbTextureDesc.SampleDesc.Quality = 0;
|
||||
vbbTextureDesc.Usage = D3D11_USAGE_DEFAULT;
|
||||
vbbTextureDesc.BindFlags = (D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET);
|
||||
vbbTextureDesc.CPUAccessFlags = 0;
|
||||
vbbTextureDesc.MiscFlags = 0;
|
||||
|
||||
m_virtualScreenTexture = nullptr;
|
||||
HRESULT result = m_device->CreateTexture2D(&vbbTextureDesc, nullptr, m_virtualScreenTexture.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitBackBuffer: CreateTexture2D for virtual screen texture failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
D3D11_RENDER_TARGET_VIEW_DESC rtvDesc;
|
||||
rtvDesc.Format = vbbFormat;
|
||||
rtvDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
|
||||
rtvDesc.Texture2D.MipSlice = 0;
|
||||
|
||||
m_virtualScreenTextureRTV = nullptr;
|
||||
HRESULT result = m_device->CreateRenderTargetView(m_virtualScreenTexture, &rtvDesc, m_virtualScreenTextureRTV.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitBackBuffer: CreateRenderTargetView for virtual screen texture failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
|
||||
srvDesc.Format = vbbFormat;
|
||||
srvDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE2D;
|
||||
srvDesc.Texture2D.MipLevels = 1;
|
||||
srvDesc.Texture2D.MostDetailedMip = 0;
|
||||
|
||||
m_virtualScreenTextureSRV = nullptr;
|
||||
HRESULT result = m_device->CreateShaderResourceView(m_virtualScreenTexture, &srvDesc, m_virtualScreenTextureSRV.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitBackBuffer: CreateRenderTargetView for virtual screen texture failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GpDisplayDriverD3D11::InitResources()
|
||||
bool GpDisplayDriverD3D11::InitResources(uint32_t virtualWidth, uint32_t virtualHeight)
|
||||
{
|
||||
if (!InitBackBuffer())
|
||||
IGpLogDriver *logger = m_properties.m_logger;
|
||||
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "GpDisplayDriverD3D11::InitResources");
|
||||
|
||||
if (!InitBackBuffer(virtualWidth, virtualHeight))
|
||||
return false;
|
||||
|
||||
// Quad vertex constant buffer
|
||||
@@ -235,8 +348,34 @@ bool GpDisplayDriverD3D11::InitResources()
|
||||
bufferDesc.MiscFlags = 0;
|
||||
bufferDesc.StructureByteStride = 0;
|
||||
|
||||
if (m_device->CreateBuffer(&bufferDesc, nullptr, m_drawQuadVertexConstantBuffer.GetMutablePtr()) != S_OK)
|
||||
HRESULT result = m_device->CreateBuffer(&bufferDesc, nullptr, m_drawQuadVertexConstantBuffer.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitResources: CreateBuffer for draw quad vertex constant buffer failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Quad pixel constant buffer
|
||||
{
|
||||
D3D11_BUFFER_DESC bufferDesc;
|
||||
bufferDesc.ByteWidth = sizeof(DrawQuadPixelConstants);
|
||||
bufferDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
bufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
bufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
bufferDesc.MiscFlags = 0;
|
||||
bufferDesc.StructureByteStride = 0;
|
||||
|
||||
HRESULT result = m_device->CreateBuffer(&bufferDesc, nullptr, m_drawQuadPixelConstantBuffer.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitResources: CreateBuffer for draw quad pixel constant buffer failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Quad index buffer
|
||||
@@ -256,8 +395,14 @@ bool GpDisplayDriverD3D11::InitResources()
|
||||
initialData.SysMemPitch = 0;
|
||||
initialData.SysMemSlicePitch = 0;
|
||||
|
||||
if (m_device->CreateBuffer(&bufferDesc, &initialData, m_quadIndexBuffer.GetMutablePtr()) != S_OK)
|
||||
HRESULT result = m_device->CreateBuffer(&bufferDesc, &initialData, m_quadIndexBuffer.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitResources: CreateBuffer for draw quad index buffer failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Quad vertex buffer
|
||||
@@ -283,19 +428,46 @@ bool GpDisplayDriverD3D11::InitResources()
|
||||
initialData.SysMemPitch = 0;
|
||||
initialData.SysMemSlicePitch = 0;
|
||||
|
||||
if (m_device->CreateBuffer(&bufferDesc, &initialData, m_quadVertexBuffer.GetMutablePtr()) != S_OK)
|
||||
HRESULT result = m_device->CreateBuffer(&bufferDesc, &initialData, m_quadVertexBuffer.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitResources: CreateBuffer for draw quad vertex buffer failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
D3D11_BUFFER_DESC bufferDesc;
|
||||
bufferDesc.ByteWidth = sizeof(ScaleQuadPixelConstants);
|
||||
bufferDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
bufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
bufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
bufferDesc.MiscFlags = 0;
|
||||
bufferDesc.StructureByteStride = 0;
|
||||
|
||||
HRESULT result = m_device->CreateBuffer(&bufferDesc, nullptr, m_scaleQuadPixelConstantBuffer.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitResources: CreateBuffer for scale quad pixel constant buffer failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const GpShaderCodeBlob drawQuadVBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuadV_D3D11);
|
||||
const GpShaderCodeBlob drawQuadPalettePBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuadPaletteP_D3D11);
|
||||
const GpShaderCodeBlob drawQuadRGBPBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuadRGBP_D3D11);
|
||||
const GpShaderCodeBlob drawQuad15BitPBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuad15BitP_D3D11);
|
||||
const GpShaderCodeBlob scaleQuadPBlob = GetBinarizedShader(GpBinarizedShaders::g_scaleQuadP_D3D11);
|
||||
|
||||
m_device->CreateVertexShader(drawQuadVBlob.m_data, drawQuadVBlob.m_size, nullptr, m_drawQuadVertexShader.GetMutablePtr());
|
||||
m_device->CreatePixelShader(drawQuadPalettePBlob.m_data, drawQuadPalettePBlob.m_size, nullptr, m_drawQuadPalettePixelShader.GetMutablePtr());
|
||||
m_device->CreatePixelShader(drawQuadRGBPBlob.m_data, drawQuadRGBPBlob.m_size, nullptr, m_drawQuadRGBPixelShader.GetMutablePtr());
|
||||
m_device->CreatePixelShader(drawQuad15BitPBlob.m_data, drawQuad15BitPBlob.m_size, nullptr, m_drawQuad15BitPixelShader.GetMutablePtr());
|
||||
m_device->CreatePixelShader(scaleQuadPBlob.m_data, scaleQuadPBlob.m_size, nullptr, m_scaleQuadPixelShader.GetMutablePtr());
|
||||
|
||||
// Quad input layout
|
||||
{
|
||||
@@ -310,7 +482,14 @@ bool GpDisplayDriverD3D11::InitResources()
|
||||
0 // Instance data step rate
|
||||
};
|
||||
|
||||
m_device->CreateInputLayout(descs, sizeof(descs) / sizeof(descs[0]), drawQuadVBlob.m_data, drawQuadVBlob.m_size, m_drawQuadInputLayout.GetMutablePtr());
|
||||
HRESULT result = m_device->CreateInputLayout(descs, sizeof(descs) / sizeof(descs[0]), drawQuadVBlob.m_data, drawQuadVBlob.m_size, m_drawQuadInputLayout.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitResources: CreateInputLayout for draw quad input failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Quad depth stencil state
|
||||
@@ -331,8 +510,14 @@ bool GpDisplayDriverD3D11::InitResources()
|
||||
desc.BackFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
|
||||
desc.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
|
||||
|
||||
if (m_device->CreateDepthStencilState(&desc, m_drawQuadDepthStencilState.GetMutablePtr()) != S_OK)
|
||||
HRESULT result = m_device->CreateDepthStencilState(&desc, m_drawQuadDepthStencilState.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitResources: CreateDepthStencilState for draw quad with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Nearest neighbor sampler desc
|
||||
@@ -349,11 +534,17 @@ bool GpDisplayDriverD3D11::InitResources()
|
||||
samplerDesc.MinLOD = -FLT_MAX;
|
||||
samplerDesc.MaxLOD = FLT_MAX;
|
||||
|
||||
if (m_device->CreateSamplerState(&samplerDesc, m_nearestNeighborSamplerState.GetMutablePtr()) != S_OK)
|
||||
HRESULT result = m_device->CreateSamplerState(&samplerDesc, m_nearestNeighborSamplerState.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitResources: CreateSamplerState for nearest neighbor failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DXGI_FORMAT paletteTextureFormat = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
|
||||
DXGI_FORMAT paletteTextureFormat = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
|
||||
// Palette texture
|
||||
{
|
||||
@@ -379,8 +570,14 @@ bool GpDisplayDriverD3D11::InitResources()
|
||||
initialData.SysMemPitch = 256 * 4;
|
||||
initialData.SysMemSlicePitch = 256 * 4;
|
||||
|
||||
if (m_device->CreateTexture1D(&desc, &initialData, m_paletteTexture.GetMutablePtr()) != S_OK)
|
||||
HRESULT result = m_device->CreateTexture1D(&desc, &initialData, m_paletteTexture.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitResources: CreateTexture1D for palette failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Palette texture SRV
|
||||
@@ -391,8 +588,14 @@ bool GpDisplayDriverD3D11::InitResources()
|
||||
desc.Texture1D.MostDetailedMip = 0;
|
||||
desc.Texture1D.MipLevels = 1;
|
||||
|
||||
if (m_device->CreateShaderResourceView(m_paletteTexture, &desc, m_paletteTextureSRV.GetMutablePtr()) != S_OK)
|
||||
HRESULT result = m_device->CreateShaderResourceView(m_paletteTexture, &desc, m_paletteTextureSRV.GetMutablePtr());
|
||||
if (result != S_OK)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::InitResources: CreateShaderResourceView for palette failed with code %lx", result);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -403,17 +606,18 @@ GpDisplayDriverTickStatus_t GpDisplayDriverD3D11::PresentFrameAndSync()
|
||||
{
|
||||
SynchronizeCursors();
|
||||
|
||||
m_deviceContext->ClearRenderTargetView(m_backBufferRTV, m_bgColor);
|
||||
m_deviceContext->ClearRenderTargetView(m_virtualScreenTextureRTV, m_bgColor);
|
||||
|
||||
ID3D11RenderTargetView *const rtv = m_backBufferRTV;
|
||||
m_deviceContext->OMSetRenderTargets(1, &rtv, nullptr);
|
||||
//ID3D11RenderTargetView *const rtv = m_backBufferRTV;
|
||||
ID3D11RenderTargetView *const vsRTV = m_virtualScreenTextureRTV;
|
||||
m_deviceContext->OMSetRenderTargets(1, &vsRTV, nullptr);
|
||||
|
||||
{
|
||||
D3D11_VIEWPORT viewport;
|
||||
viewport.TopLeftX = 0;
|
||||
viewport.TopLeftY = 0;
|
||||
viewport.Width = static_cast<FLOAT>(m_windowWidthPhysical);
|
||||
viewport.Height = static_cast<FLOAT>(m_windowHeightPhysical);
|
||||
viewport.Width = static_cast<FLOAT>(m_windowWidthVirtual);
|
||||
viewport.Height = static_cast<FLOAT>(m_windowHeightVirtual);
|
||||
viewport.MinDepth = 0.0f;
|
||||
viewport.MaxDepth = 1.0f;
|
||||
|
||||
@@ -422,6 +626,8 @@ GpDisplayDriverTickStatus_t GpDisplayDriverD3D11::PresentFrameAndSync()
|
||||
|
||||
m_properties.m_renderFunc(m_properties.m_renderFuncContext);
|
||||
|
||||
ScaleVirtualScreen();
|
||||
|
||||
DXGI_PRESENT_PARAMETERS presentParams;
|
||||
|
||||
ZeroMemory(&presentParams, sizeof(presentParams));
|
||||
@@ -539,6 +745,105 @@ GpDisplayDriverTickStatus_t GpDisplayDriverD3D11::PresentFrameAndSync()
|
||||
return GpDisplayDriverTickStatuses::kOK;
|
||||
}
|
||||
|
||||
void GpDisplayDriverD3D11::ScaleVirtualScreen()
|
||||
{
|
||||
{
|
||||
D3D11_VIEWPORT viewport;
|
||||
viewport.TopLeftX = 0;
|
||||
viewport.TopLeftY = 0;
|
||||
viewport.Width = static_cast<FLOAT>(m_windowWidthPhysical);
|
||||
viewport.Height = static_cast<FLOAT>(m_windowHeightPhysical);
|
||||
viewport.MinDepth = 0.0f;
|
||||
viewport.MaxDepth = 1.0f;
|
||||
|
||||
m_deviceContext->RSSetViewports(1, &viewport);
|
||||
}
|
||||
|
||||
|
||||
ID3D11Buffer *vbPtr = m_quadVertexBuffer;
|
||||
UINT vbStride = sizeof(float) * 2;
|
||||
UINT zero = 0;
|
||||
|
||||
ID3D11RenderTargetView *const rtv = m_backBufferRTV;
|
||||
m_deviceContext->OMSetRenderTargets(1, &rtv, nullptr);
|
||||
|
||||
//m_deviceContext->OMSetDepthStencilState(m_drawQuadDepthStencilState, 0);
|
||||
|
||||
{
|
||||
const float twoDivWidth = 2.0f / static_cast<float>(m_windowWidthPhysical);
|
||||
const float negativeTwoDivHeight = -2.0f / static_cast<float>(m_windowHeightPhysical);
|
||||
|
||||
// Use the scaled virtual width instead of the physical width to correctly handle cases where the window boundary is in the middle of a pixel
|
||||
float fWidth = static_cast<float>(m_windowWidthVirtual) * m_pixelScaleX;
|
||||
float fHeight = static_cast<float>(m_windowHeightVirtual) * m_pixelScaleY;
|
||||
|
||||
DrawQuadVertexConstants vConstantsData;
|
||||
vConstantsData.m_ndcOriginX = twoDivWidth - 1.0f;
|
||||
vConstantsData.m_ndcOriginY = negativeTwoDivHeight + 1.0f;
|
||||
vConstantsData.m_ndcWidth = fWidth * twoDivWidth;
|
||||
vConstantsData.m_ndcHeight = fHeight * negativeTwoDivHeight;
|
||||
|
||||
vConstantsData.m_surfaceDimensionX = static_cast<float>(m_windowWidthVirtual);
|
||||
vConstantsData.m_surfaceDimensionY = static_cast<float>(m_windowHeightVirtual);
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE mappedVConstants;
|
||||
if (m_deviceContext->Map(m_drawQuadVertexConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedVConstants) == S_OK)
|
||||
{
|
||||
memcpy(mappedVConstants.pData, &vConstantsData, sizeof(vConstantsData));
|
||||
m_deviceContext->Unmap(m_drawQuadVertexConstantBuffer, 0);
|
||||
}
|
||||
|
||||
ScaleQuadPixelConstants pConstantsData;
|
||||
pConstantsData.m_dx = static_cast<float>(static_cast<double>(m_windowWidthVirtual) / static_cast<double>(m_windowWidthPhysical));
|
||||
pConstantsData.m_dy = static_cast<float>(static_cast<double>(m_windowHeightVirtual) / static_cast<double>(m_windowHeightPhysical));
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE mappedPConstants;
|
||||
if (m_deviceContext->Map(m_scaleQuadPixelConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedPConstants) == S_OK)
|
||||
{
|
||||
memcpy(mappedPConstants.pData, &pConstantsData, sizeof(pConstantsData));
|
||||
m_deviceContext->Unmap(m_scaleQuadPixelConstantBuffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
m_deviceContext->IASetVertexBuffers(0, 1, &vbPtr, &vbStride, &zero);
|
||||
m_deviceContext->IASetIndexBuffer(m_quadIndexBuffer, DXGI_FORMAT_R16_UINT, 0);
|
||||
m_deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
m_deviceContext->IASetInputLayout(m_drawQuadInputLayout);
|
||||
|
||||
ID3D11Buffer *vsConstants = m_drawQuadVertexConstantBuffer;
|
||||
m_deviceContext->VSSetShader(m_drawQuadVertexShader, nullptr, 0);
|
||||
m_deviceContext->VSSetConstantBuffers(0, 1, &vsConstants);
|
||||
|
||||
ID3D11SamplerState *samplerStates[] =
|
||||
{
|
||||
m_nearestNeighborSamplerState,
|
||||
};
|
||||
m_deviceContext->PSSetSamplers(0, sizeof(samplerStates) / sizeof(samplerStates[0]), samplerStates);
|
||||
|
||||
|
||||
ID3D11ShaderResourceView *psResourceViews[] =
|
||||
{
|
||||
m_virtualScreenTextureSRV,
|
||||
};
|
||||
|
||||
ID3D11Buffer *psConstants = m_scaleQuadPixelConstantBuffer;
|
||||
|
||||
m_deviceContext->PSSetShader(m_scaleQuadPixelShader, nullptr, 0);
|
||||
m_deviceContext->PSSetShaderResources(0, sizeof(psResourceViews) / sizeof(psResourceViews[0]), psResourceViews);
|
||||
m_deviceContext->PSSetConstantBuffers(0, 1, &psConstants);
|
||||
|
||||
m_deviceContext->DrawIndexed(6, 0, 0);
|
||||
|
||||
ID3D11ShaderResourceView *unbindPSResourceViews[] =
|
||||
{
|
||||
0,
|
||||
};
|
||||
m_deviceContext->PSSetShaderResources(0, sizeof(unbindPSResourceViews) / sizeof(unbindPSResourceViews[0]), unbindPSResourceViews);
|
||||
|
||||
ID3D11Buffer *clearBuffer = nullptr;
|
||||
m_deviceContext->PSSetConstantBuffers(0, 1, &clearBuffer);
|
||||
}
|
||||
|
||||
void GpDisplayDriverD3D11::SynchronizeCursors()
|
||||
{
|
||||
HCURSOR replacementCursor = nullptr;
|
||||
@@ -613,11 +918,21 @@ void GpDisplayDriverD3D11::ChangeToStandardCursor(EGpStandardCursor_t cursor)
|
||||
|
||||
void GpDisplayDriverD3D11::BecomeFullScreen(LONG &windowStyle)
|
||||
{
|
||||
IGpLogDriver *logger = m_properties.m_logger;
|
||||
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "GpDisplayDriverD3D11::BecomeFullScreen");
|
||||
|
||||
assert(!m_isFullScreen);
|
||||
|
||||
RECT windowRect;
|
||||
if (!GetWindowRect(m_osGlobals->m_hwnd, &windowRect))
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::BecomeFullScreen: GetWindowRect failed");
|
||||
|
||||
return; // ???
|
||||
}
|
||||
|
||||
HMONITOR monitor = MonitorFromRect(&windowRect, MONITOR_DEFAULTTONULL);
|
||||
if (!monitor)
|
||||
@@ -632,17 +947,31 @@ void GpDisplayDriverD3D11::BecomeFullScreen(LONG &windowStyle)
|
||||
}
|
||||
|
||||
if (!monitor)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::BecomeFullScreen: Couldn't find any monitors");
|
||||
|
||||
return; // No monitor?
|
||||
}
|
||||
|
||||
MONITORINFO monitorInfo;
|
||||
monitorInfo.cbSize = sizeof(monitorInfo);
|
||||
if (!GetMonitorInfoA(monitor, &monitorInfo))
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::BecomeFullScreen: GetMonitorInfoA failed");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m_windowModeRevertRect = windowRect;
|
||||
SetWindowLongPtr(m_osGlobals->m_hwnd, GWL_STYLE, WS_VISIBLE | WS_POPUP);
|
||||
|
||||
SetWindowPos(m_osGlobals->m_hwnd, HWND_TOP, monitorInfo.rcMonitor.left, monitorInfo.rcMonitor.top, monitorInfo.rcMonitor.right - monitorInfo.rcMonitor.left, monitorInfo.rcMonitor.bottom - monitorInfo.rcMonitor.top, SWP_FRAMECHANGED);
|
||||
if (!SetWindowPos(m_osGlobals->m_hwnd, HWND_TOP, monitorInfo.rcMonitor.left, monitorInfo.rcMonitor.top, monitorInfo.rcMonitor.right - monitorInfo.rcMonitor.left, monitorInfo.rcMonitor.bottom - monitorInfo.rcMonitor.top, SWP_FRAMECHANGED))
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::BecomeFullScreen: SetWindowPos failed");
|
||||
}
|
||||
|
||||
m_isFullScreen = true;
|
||||
windowStyle = (WS_VISIBLE | WS_POPUP);
|
||||
@@ -650,6 +979,11 @@ void GpDisplayDriverD3D11::BecomeFullScreen(LONG &windowStyle)
|
||||
|
||||
void GpDisplayDriverD3D11::BecomeWindowed(LONG &windowStyle)
|
||||
{
|
||||
IGpLogDriver *logger = m_properties.m_logger;
|
||||
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Information, "GpDisplayDriverD3D11::BecomeWindowed");
|
||||
|
||||
assert(m_isFullScreen);
|
||||
|
||||
RECT revertRect = m_windowModeRevertRect;
|
||||
@@ -660,12 +994,22 @@ void GpDisplayDriverD3D11::BecomeWindowed(LONG &windowStyle)
|
||||
// If the window is off-screen, use the primary monitor
|
||||
monitor = MonitorFromRect(&revertRect, MONITOR_DEFAULTTOPRIMARY);
|
||||
if (!monitor)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::BecomeWindowed: MonitorFromRect fallback failed");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
MONITORINFO monitorInfo;
|
||||
monitorInfo.cbSize = sizeof(monitorInfo);
|
||||
if (!GetMonitorInfoA(monitor, &monitorInfo))
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::BecomeWindowed: GetMonitorInfoA failed");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
RECT monitorRect = monitorInfo.rcWork;
|
||||
LONG monitorWidth = monitorRect.right - monitorRect.left;
|
||||
@@ -702,9 +1046,13 @@ void GpDisplayDriverD3D11::BecomeWindowed(LONG &windowStyle)
|
||||
revertRect.right = revertRect.right + revertWidth;
|
||||
}
|
||||
|
||||
SetWindowLongPtr(m_osGlobals->m_hwnd, GWL_STYLE, WS_VISIBLE | WS_OVERLAPPEDWINDOW);
|
||||
SetWindowLongPtrW(m_osGlobals->m_hwnd, GWL_STYLE, WS_VISIBLE | WS_OVERLAPPEDWINDOW);
|
||||
|
||||
SetWindowPos(m_osGlobals->m_hwnd, HWND_TOP, revertRect.left, revertRect.top, revertRect.right - revertRect.left, revertRect.bottom - revertRect.top, SWP_FRAMECHANGED);
|
||||
if (!SetWindowPos(m_osGlobals->m_hwnd, HWND_TOP, revertRect.left, revertRect.top, revertRect.right - revertRect.left, revertRect.bottom - revertRect.top, SWP_FRAMECHANGED))
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "GpDisplayDriverD3D11::BecomeWindowed: SetWindowPos failed");
|
||||
}
|
||||
|
||||
m_isFullScreen = false;
|
||||
windowStyle = (WS_VISIBLE | WS_OVERLAPPEDWINDOW);
|
||||
@@ -712,11 +1060,18 @@ void GpDisplayDriverD3D11::BecomeWindowed(LONG &windowStyle)
|
||||
|
||||
void GpDisplayDriverD3D11::Run()
|
||||
{
|
||||
IGpLogDriver *logger = m_properties.m_logger;
|
||||
|
||||
WNDCLASSEX wc;
|
||||
|
||||
LPVOID fiber = ConvertThreadToFiberEx(this, 0);
|
||||
if (!fiber)
|
||||
{
|
||||
if (logger)
|
||||
logger->Printf(IGpLogDriver::Category_Error, "ConvertThreadToFiberEx failed");
|
||||
|
||||
return; // ???
|
||||
}
|
||||
|
||||
m_vosFiber = m_osGlobals->m_createFiberFunc(fiber);
|
||||
|
||||
@@ -727,6 +1082,8 @@ void GpDisplayDriverD3D11::Run()
|
||||
wc.lpfnWndProc = WinProc;
|
||||
wc.hInstance = m_osGlobals->m_hInstance;
|
||||
wc.hCursor = m_arrowCursor;
|
||||
wc.hIcon = m_osGlobals->m_hIcon;
|
||||
wc.hIconSm = m_osGlobals->m_hIconSm;
|
||||
wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
|
||||
wc.lpszClassName = "GPD3D11WindowClass";
|
||||
|
||||
@@ -739,13 +1096,13 @@ void GpDisplayDriverD3D11::Run()
|
||||
RECT wr = { 0, 0, m_windowWidthPhysical, m_windowHeightPhysical };
|
||||
AdjustWindowRect(&wr, windowStyle, menus != NULL);
|
||||
|
||||
m_osGlobals->m_hwnd = CreateWindowExW(NULL, L"GPD3D11WindowClass", GP_APPLICATION_NAME_W L" (Direct3D 11)", WS_OVERLAPPEDWINDOW, 300, 300, wr.right - wr.left, wr.bottom - wr.top, NULL, menus, m_osGlobals->m_hInstance, NULL);
|
||||
m_osGlobals->m_hwnd = CreateWindowExW(NULL, L"GPD3D11WindowClass", GP_APPLICATION_NAME_W, WS_OVERLAPPEDWINDOW, 300, 300, wr.right - wr.left, wr.bottom - wr.top, NULL, menus, m_osGlobals->m_hInstance, NULL);
|
||||
|
||||
ShowWindow(m_osGlobals->m_hwnd, m_osGlobals->m_nCmdShow);
|
||||
|
||||
StartD3DForWindow(m_osGlobals->m_hwnd, m_swapChain, m_device, m_deviceContext);
|
||||
StartD3DForWindow(m_osGlobals->m_hwnd, m_swapChain, m_device, m_deviceContext, logger);
|
||||
|
||||
InitResources();
|
||||
InitResources(m_windowWidthVirtual, m_windowHeightVirtual);
|
||||
|
||||
LARGE_INTEGER lastTimestamp;
|
||||
memset(&lastTimestamp, 0, sizeof(lastTimestamp));
|
||||
@@ -797,8 +1154,10 @@ void GpDisplayDriverD3D11::Run()
|
||||
unsigned int desiredHeight = clientRect.bottom - clientRect.top;
|
||||
if (clientRect.right - clientRect.left != m_windowWidthPhysical || clientRect.bottom - clientRect.top != m_windowHeightPhysical)
|
||||
{
|
||||
uint32_t prevWidth = m_windowWidthPhysical;
|
||||
uint32_t prevHeight = m_windowHeightPhysical;
|
||||
uint32_t prevWidthPhysical = m_windowWidthPhysical;
|
||||
uint32_t prevHeightPhysical = m_windowHeightPhysical;
|
||||
uint32_t prevWidthVirtual = m_windowWidthVirtual;
|
||||
uint32_t prevHeightVirtual = m_windowHeightVirtual;
|
||||
uint32_t virtualWidth = m_windowWidthVirtual;
|
||||
uint32_t virtualHeight = m_windowHeightVirtual;
|
||||
float pixelScaleX = 1.0f;
|
||||
@@ -806,10 +1165,10 @@ void GpDisplayDriverD3D11::Run()
|
||||
|
||||
if (m_properties.m_adjustRequestedResolutionFunc(m_properties.m_adjustRequestedResolutionFuncContext, desiredWidth, desiredHeight, virtualWidth, virtualHeight, pixelScaleX, pixelScaleY))
|
||||
{
|
||||
bool resizedOK = ResizeD3DWindow(m_osGlobals->m_hwnd, m_windowWidthPhysical, m_windowHeightPhysical, desiredWidth, desiredHeight, windowStyle, menus);
|
||||
bool resizedOK = ResizeD3DWindow(m_osGlobals->m_hwnd, m_windowWidthPhysical, m_windowHeightPhysical, desiredWidth, desiredHeight, windowStyle, menus, logger);
|
||||
resizedOK = resizedOK && DetachSwapChain();
|
||||
resizedOK = resizedOK && ResizeSwapChain(m_swapChain, m_windowWidthPhysical, m_windowHeightPhysical);
|
||||
resizedOK = resizedOK && InitBackBuffer();
|
||||
resizedOK = resizedOK && InitBackBuffer(virtualWidth, virtualHeight);
|
||||
|
||||
if (!resizedOK)
|
||||
break; // Critical video driver error, exit
|
||||
@@ -822,8 +1181,8 @@ void GpDisplayDriverD3D11::Run()
|
||||
if (GpVOSEvent *resizeEvent = m_properties.m_eventQueue->QueueEvent())
|
||||
{
|
||||
resizeEvent->m_eventType = GpVOSEventTypes::kVideoResolutionChanged;
|
||||
resizeEvent->m_event.m_resolutionChangedEvent.m_prevWidth = prevWidth;
|
||||
resizeEvent->m_event.m_resolutionChangedEvent.m_prevHeight = prevHeight;
|
||||
resizeEvent->m_event.m_resolutionChangedEvent.m_prevWidth = prevWidthVirtual;
|
||||
resizeEvent->m_event.m_resolutionChangedEvent.m_prevHeight = prevHeightVirtual;
|
||||
resizeEvent->m_event.m_resolutionChangedEvent.m_newWidth = m_windowWidthVirtual;
|
||||
resizeEvent->m_event.m_resolutionChangedEvent.m_newHeight = m_windowHeightVirtual;
|
||||
}
|
||||
@@ -861,8 +1220,11 @@ IGpDisplayDriverSurface *GpDisplayDriverD3D11::CreateSurface(size_t width, size_
|
||||
return GpDisplayDriverSurfaceD3D11::Create(m_device, m_deviceContext, width, height, pixelFormat);
|
||||
}
|
||||
|
||||
void GpDisplayDriverD3D11::DrawSurface(IGpDisplayDriverSurface *surface, int32_t x, int32_t y, size_t width, size_t height)
|
||||
void GpDisplayDriverD3D11::DrawSurface(IGpDisplayDriverSurface *surface, int32_t x, int32_t y, size_t width, size_t height, const GpDisplayDriverSurfaceEffects *effects)
|
||||
{
|
||||
if (!effects)
|
||||
effects = &gs_defaultEffects;
|
||||
|
||||
ID3D11Buffer *vbPtr = m_quadVertexBuffer;
|
||||
UINT vbStride = sizeof(float) * 2;
|
||||
UINT zero = 0;
|
||||
@@ -875,21 +1237,52 @@ void GpDisplayDriverD3D11::DrawSurface(IGpDisplayDriverSurface *surface, int32_t
|
||||
const float twoDivWidth = 2.0f / static_cast<float>(m_windowWidthVirtual);
|
||||
const float negativeTwoDivHeight = -2.0f / static_cast<float>(m_windowHeightVirtual);
|
||||
|
||||
DrawQuadVertexConstants constantsData;
|
||||
constantsData.m_ndcOriginX = static_cast<float>(x) * twoDivWidth - 1.0f;
|
||||
constantsData.m_ndcOriginY = static_cast<float>(y) * negativeTwoDivHeight + 1.0f;
|
||||
constantsData.m_ndcWidth = static_cast<float>(width) * twoDivWidth;
|
||||
constantsData.m_ndcHeight = static_cast<float>(height) * negativeTwoDivHeight;
|
||||
DrawQuadVertexConstants vConstantsData;
|
||||
vConstantsData.m_ndcOriginX = static_cast<float>(x) * twoDivWidth - 1.0f;
|
||||
vConstantsData.m_ndcOriginY = static_cast<float>(y) * negativeTwoDivHeight + 1.0f;
|
||||
vConstantsData.m_ndcWidth = static_cast<float>(width) * twoDivWidth;
|
||||
vConstantsData.m_ndcHeight = static_cast<float>(height) * negativeTwoDivHeight;
|
||||
|
||||
constantsData.m_surfaceDimensionX = static_cast<float>(d3d11Surface->GetWidth());
|
||||
constantsData.m_surfaceDimensionY = static_cast<float>(d3d11Surface->GetHeight());
|
||||
vConstantsData.m_surfaceDimensionX = static_cast<float>(d3d11Surface->GetWidth());
|
||||
vConstantsData.m_surfaceDimensionY = static_cast<float>(d3d11Surface->GetHeight());
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE mappedConstants;
|
||||
if (m_deviceContext->Map(m_drawQuadVertexConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedConstants) == S_OK)
|
||||
D3D11_MAPPED_SUBRESOURCE vMappedConstants;
|
||||
if (m_deviceContext->Map(m_drawQuadVertexConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &vMappedConstants) == S_OK)
|
||||
{
|
||||
memcpy(mappedConstants.pData, &constantsData, sizeof(constantsData));
|
||||
memcpy(vMappedConstants.pData, &vConstantsData, sizeof(vConstantsData));
|
||||
m_deviceContext->Unmap(m_drawQuadVertexConstantBuffer, 0);
|
||||
}
|
||||
|
||||
DrawQuadPixelConstants pConstantsData;
|
||||
for (int i = 0; i < 4; i++)
|
||||
pConstantsData.m_modulation[i] = 1.0f;
|
||||
|
||||
if (effects->m_flicker)
|
||||
{
|
||||
pConstantsData.m_flickerAxis[0] = effects->m_flickerAxisX;
|
||||
pConstantsData.m_flickerAxis[1] = effects->m_flickerAxisY;
|
||||
pConstantsData.m_flickerStart = effects->m_flickerStartThreshold;
|
||||
pConstantsData.m_flickerEnd = effects->m_flickerEndThreshold;
|
||||
}
|
||||
else
|
||||
{
|
||||
pConstantsData.m_flickerAxis[0] = pConstantsData.m_flickerAxis[1] = 0;
|
||||
pConstantsData.m_flickerEnd = -1;
|
||||
pConstantsData.m_flickerStart = -2;
|
||||
}
|
||||
|
||||
pConstantsData.m_desaturation = effects->m_desaturation;
|
||||
|
||||
if (effects->m_darken)
|
||||
for (int i = 0; i < 3; i++)
|
||||
pConstantsData.m_modulation[i] = 0.5f;
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE pMappedConstants;
|
||||
if (m_deviceContext->Map(m_drawQuadPixelConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &pMappedConstants) == S_OK)
|
||||
{
|
||||
memcpy(pMappedConstants.pData, &pConstantsData, sizeof(pConstantsData));
|
||||
m_deviceContext->Unmap(m_drawQuadPixelConstantBuffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
m_deviceContext->IASetVertexBuffers(0, 1, &vbPtr, &vbStride, &zero);
|
||||
@@ -907,6 +1300,9 @@ void GpDisplayDriverD3D11::DrawSurface(IGpDisplayDriverSurface *surface, int32_t
|
||||
};
|
||||
m_deviceContext->PSSetSamplers(0, sizeof(samplerStates) / sizeof(samplerStates[0]), samplerStates);
|
||||
|
||||
ID3D11Buffer *psConstants = m_drawQuadPixelConstantBuffer;
|
||||
m_deviceContext->PSSetConstantBuffers(0, 1, &psConstants);
|
||||
|
||||
GpPixelFormat_t pixelFormat = d3d11Surface->GetPixelFormat();
|
||||
if (pixelFormat == GpPixelFormats::k8BitStandard || pixelFormat == GpPixelFormats::k8BitCustom)
|
||||
{
|
||||
@@ -1020,7 +1416,7 @@ void GpDisplayDriverD3D11::SetBackgroundColor(uint8_t r, uint8_t g, uint8_t b, u
|
||||
|
||||
void GpDisplayDriverD3D11::RequestToggleFullScreen(uint32_t timestamp)
|
||||
{
|
||||
// Alt-Enter gets re-sent after a full-screen toggle, so we ignore toggle requests until half a second has seconds have elapsed
|
||||
// Alt-Enter gets re-sent after a full-screen toggle, so we ignore toggle requests until half a second has elapsed
|
||||
if (timestamp > m_lastFullScreenToggleTimeStamp + 30)
|
||||
{
|
||||
m_isFullScreenDesired = !m_isFullScreenDesired;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user