Compare commits

...

50 Commits

Author SHA1 Message Date
elasota
7069f4bf82 Add package release script 2020-07-03 14:04:54 -04:00
elasota
b197a9fb4b Fix copyright 2020-07-03 13:53:19 -04:00
elasota
62427de092 Add ICC profile option 2020-07-03 13:53:10 -04:00
elasota
037994d0f7 Add additional credits 2020-07-03 13:48:48 -04:00
elasota
7cdfc40ad9 Clarified ambiguous language 2020-07-03 13:48:33 -04:00
elasota
c53275d3fb Bump version to 1.0.4 2020-07-03 05:08:52 -04:00
elasota
8d58d22731 Add build version 2020-07-03 05:05:12 -04:00
elasota
58ad634085 Re-add clipboard functions 2020-07-03 04:59:40 -04:00
elasota
00ea1b2982 Fix invert image draw not working correctly if the image is partially out of bounds (happens when moving a tiki torch in the editor) 2020-07-03 04:18:08 -04:00
elasota
87bab26d47 Add home/end key support to edit box 2020-07-03 04:08:09 -04:00
elasota
3dbb231c5a Add edit box automatic scrolling 2020-07-03 04:00:25 -04:00
elasota
a2e8d414e8 Fix typing sound not working with forward delete 2020-07-03 03:16:42 -04:00
elasota
137f00b657 Fixed selection drawing out of bounds in multi-line editbox 2020-07-03 03:05:25 -04:00
elasota
7fec622e51 Add forward delete to editbox 2020-07-03 03:02:43 -04:00
elasota
05604e5604 Add API for saving driver prefs. Save fullscreen state in D3D11 driver. 2020-07-03 02:46:43 -04:00
elasota
ed9e0fec97 Update readme 2020-07-03 02:45:41 -04:00
elasota
82b93c627e Save house after opening so it doesn't throw an IO error if the user quits immediately. 2020-06-20 02:16:43 -04:00
elasota
c204b5ef7f Fix debug compile failure 2020-06-20 02:09:32 -04:00
elasota
343a8a0f04 Bump build version to 1.0.3 2020-06-20 02:08:35 -04:00
elasota
9d5adb9bb6 Remove port state, fix background not darkening in room editor 2020-06-20 02:08:22 -04:00
elasota
3bf689664f Default menu bar color to black 2020-06-20 01:46:38 -04:00
elasota
ccb7dd2edb Remove unused var 2020-06-20 01:46:27 -04:00
elasota
20acb4ef6b Bump prefs version 2020-06-20 01:33:47 -04:00
elasota
3c662845b4 Add option to enable or disable auto-scale 2020-06-20 01:33:26 -04:00
elasota
1981320afe Add support for 16-bit, stereo, and MACE 3:1 sound import. 2020-06-20 01:03:41 -04:00
elasota
1c15ea5940 Update project readme 2020-06-13 05:32:27 -04:00
elasota
4920781619 32-bit color support 2020-06-13 04:33:41 -04:00
elasota
24f43b973a Fix build timestamp 2020-06-07 22:17:02 -04:00
elasota
649d78a61b Tag release 1.0.1 2020-06-07 21:05:08 -04:00
elasota
836fc95f4a EOL fix 2020-06-07 20:45:30 -04:00
elasota
5b95fd8c6b Use Apple RGB color profile 2020-06-07 20:42:49 -04:00
elasota
b55a508686 Use error diffusion for 24-to-8 picture draws 2020-06-07 20:42:07 -04:00
elasota
47291cbf1d Support custom pause and banner graphics 2020-06-07 19:36:53 -04:00
elasota
01e6ff4f5d Fix >16bpp images emitting color table data, causing image corruption, especially in 24bpp images 2020-06-07 17:45:29 -04:00
elasota
d828eacd38 Clean "Packaged" dir when converting resources 2020-06-07 17:20:21 -04:00
elasota
b37b0a4f8a Add MACE 6:1 decompression to fix some missing audio samples, parallelize deflate compression 2020-06-07 17:18:04 -04:00
elasota
4c3ccbd7fa Only copy PDBs that are actually in the release package 2020-06-06 02:32:05 -04:00
elasota
9624c283c8 Updated version tagging and added about dialog 2020-06-06 02:25:10 -04:00
elasota
cfb66d9c9b Fix res patch file adding not working 2020-06-06 01:49:54 -04:00
elasota
c185c8d9ec Fix filters 2020-06-05 23:33:58 -04:00
elasota
7636fd6fa8 Remove unused file 2020-06-05 23:25:08 -04:00
elasota
6c48debecd Code cleanup 2020-06-05 23:21:56 -04:00
elasota
3f55eedcf0 Remove unused header 2020-06-05 23:19:47 -04:00
elasota
856c7d5297 Remove unused header 2020-06-05 22:17:35 -04:00
elasota
d7301402c5 Fix broken release script 2020-06-04 17:26:02 -04:00
elasota
2a98bfbc8c Remove AppleEvents API 2020-06-02 20:01:16 -04:00
elasota
eac923c475 Refactoring 2020-06-01 00:38:24 -04:00
elasota
6fe0f2d964 API refactoring 2020-06-01 00:33:50 -04:00
elasota
a4abb0d95f Use XAudio 2.9 redistributable instead of 2.9 SDK. Should fix Win7 compatibility. 2020-05-31 21:19:51 -04:00
elasota
c856607f46 Fixed some documentation issues 2020-05-29 22:03:13 -04:00
156 changed files with 4607 additions and 1487 deletions

5
.gitignore vendored
View File

@@ -28,6 +28,9 @@ InstallerPackages/*
*.msi
*.wixpdb
*.wixobj
*.CopyComplete
ReleasePackageInstaller/obj/*
ReleasePackageInstaller/bin/*
ReleasePackageInstaller/AerofoilPackageDefs.wxi
ReleasePackageInstaller/AerofoilPackageDefs.wxi
ReleasePackageInstaller/AerofoilPackageVersion.wxi
packages/*

View File

@@ -27,4 +27,10 @@ Distributed under zlib license (See zlib/README)
The Unarchiver:
Copyright (C) 2006-2013 Dag Ågren
Distributed under the LGPLv2 license (See unpacktool/LICENSE.txt)
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)

View File

@@ -46,9 +46,14 @@ 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
@@ -237,6 +242,14 @@ Global
{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

View File

@@ -170,6 +170,7 @@
<ClInclude Include="..\GpCommon\EGpInputDriverType.h" />
<ClInclude Include="..\GpCommon\EGpStandardCursor.h" />
<ClInclude Include="..\GpCommon\GpApplicationName.h" />
<ClInclude Include="..\GpCommon\GpBuildVersion.h" />
<ClInclude Include="..\GpCommon\GpDisplayDriverTickStatus.h" />
<ClInclude Include="..\GpCommon\GpFileCreationDisposition.h" />
<ClInclude Include="..\GpCommon\GpInputDriverProperties.h" />
@@ -177,6 +178,7 @@
<ClInclude Include="..\GpCommon\IGpAudioChannelCallbacks.h" />
<ClInclude Include="..\GpCommon\IGpDisplayDriverSurface.h" />
<ClInclude Include="..\GpCommon\IGpLogDriver.h" />
<ClInclude Include="..\GpCommon\IGpPrefsHandler.h" />
<ClInclude Include="GpAppEnvironment.h" />
<ClInclude Include="GpAudioDriverFactory.h" />
<ClInclude Include="GpDisplayDriverFactory.h" />

View File

@@ -147,7 +147,15 @@
<ClInclude Include="..\GpCommon\IGpLogDriver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GpLogDriver_Win32.h" />
<ClInclude Include="GpLogDriver_Win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\IGpPrefsHandler.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\GpCommon\GpBuildVersion.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="ConvertedResources\Large128.ico">

View File

@@ -142,6 +142,7 @@ void GpAppEnvironment::InitializeApplicationState()
{
GpAppInterface_Get()->PL_HostDisplayDriver_SetInstance(m_displayDriver);
GpAppInterface_Get()->PL_HostAudioDriver_SetInstance(m_audioDriver);
GpAppInterface_Get()->PL_HostInputDriver_SetInstances(m_inputDrivers, m_numInputDrivers);
GpAppInterface_Get()->PL_InstallHostSuspendHook(GpAppEnvironment::StaticSuspendHookFunc, this);
GpAppInterface_Get()->PL_HostFontHandler_SetInstance(m_fontHandler);

View File

@@ -429,6 +429,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
g_gpWindowsGlobals.m_translateWindowsMessageFunc = TranslateWindowsMessage;
g_gpGlobalConfig.m_displayDriverType = EGpDisplayDriverType_D3D11;
g_gpGlobalConfig.m_audioDriverType = EGpAudioDriverType_XAudio2;
EGpInputDriverType inputDrivers[] =

View File

@@ -65,10 +65,34 @@
"id" : 0,
"enabled" : false
},
{
"name" : "32-bit color (Requires restart)",
"itemType" : "CheckBox",
"pos" : [ 8, 85 ],
"size" : [ 256, 18 ],
"id" : 0,
"enabled" : true
},
{
"name" : "Adjust resolution to fit window",
"itemType" : "CheckBox",
"pos" : [ 8, 105 ],
"size" : [ 256, 18 ],
"id" : 0,
"enabled" : true
},
{
"name" : "Simulate Apple RGB monitor",
"itemType" : "CheckBox",
"pos" : [ 8, 125 ],
"size" : [ 256, 18 ],
"id" : 0,
"enabled" : true
},
{
"name" : "Beautiful opening color fade",
"itemType" : "CheckBox",
"pos" : [ 8, 142 ],
"pos" : [ 8, 152 ],
"size" : [ 256, 18 ],
"id" : 0,
"enabled" : true
@@ -76,7 +100,7 @@
{
"name" : "",
"itemType" : "UserItem",
"pos" : [ 8, 137 ],
"pos" : [ 8, 147 ],
"size" : [ 317, 1 ],
"id" : 0,
"enabled" : false

View File

@@ -0,0 +1,13 @@
{
"items" :
[
{
"name" : "Okay",
"itemType" : "Button",
"pos" : [ 376, 240 ],
"size" : [ 58, 20 ],
"id" : 1,
"enabled" : true
}
]
}

View File

@@ -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" :
[

View File

@@ -19,6 +19,11 @@ const D3D_SHADER_MACRO drawQuadDefs[] =
{ nullptr }
};
const D3D_SHADER_MACRO drawQuadICCProfileDefs[] =
{
{ "USE_ICC_PROFILE", nullptr }
};
const CompileJob kCompileJobs[] =
{
{
@@ -37,6 +42,14 @@ const CompileJob kCompileJobs[] =
"PSMain",
"ps_4_0"
},
{
L"ShaderSrc\\DrawQuadRGBP.hlsl",
L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuadRGBP_ICC_D3D11.cpp",
"g_drawQuadRGBICCP_D3D11",
drawQuadICCProfileDefs,
"PSMain",
"ps_4_0"
},
{
L"ShaderSrc\\DrawQuadPaletteP.hlsl",
L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuadPaletteP_D3D11.cpp",
@@ -45,6 +58,14 @@ const CompileJob kCompileJobs[] =
"PSMain",
"ps_4_0"
},
{
L"ShaderSrc\\DrawQuadPaletteP.hlsl",
L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuadPaletteP_ICC_D3D11.cpp",
"g_drawQuadPaletteICCP_D3D11",
drawQuadICCProfileDefs,
"PSMain",
"ps_4_0"
},
{
L"ShaderSrc\\DrawQuad15BitP.hlsl",
L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuad15BitP_D3D11.cpp",
@@ -53,6 +74,14 @@ const CompileJob kCompileJobs[] =
"PSMain",
"ps_4_0"
},
{
L"ShaderSrc\\DrawQuad15BitP.hlsl",
L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuad15BitP_ICC_D3D11.cpp",
"g_drawQuad15BitICCP_D3D11",
drawQuadICCProfileDefs,
"PSMain",
"ps_4_0"
},
{
L"ShaderSrc\\ScaleQuadP.hlsl",
L"GpDisplayDriver_D3D11\\CompiledShaders\\ScaleQuadP_D3D11.cpp",

View File

@@ -1,3 +1,5 @@
rmdir /S /Q Packaged
mkdir Packaged
mkdir Packaged\Houses
mkdir Packaged\WinCursors

View File

@@ -1,7 +1,8 @@
Many Glider PRO houses, including the bundled ones, contain images in QuickDraw
PICT format in the game resource data.
Additionally, some PICT features are impossible to support because they
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.

View File

@@ -26,7 +26,36 @@ 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)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
A copy of the license is included in the accompanying license_gplv2.txt file.
ADDITIONAL CREDITS
-------------------------------------------------------------------------------
* Demo House and CD Demo House are by John Calhoun and Kim Money.
* Davis Station, Metropolis and Titanic are by Jonathan Chin (alias Paul Finn) and John Calhoun.
* Grand Prix, Leviathan, ImagineHouse PRO II and In The Mirror are by Jonathan Chin (alias Paul Finn).
* Land of Illusion, Nemo's Market, Rainbow's End and SpacePods are by Ward Hartenstein.
* Slumberland is by John Calhoun (first house and top of fourth house) Jonathan Chin (second house), Steve Sullivan (third house) and Ward Hartenstein (bottom of fourth house).
* Teddy World is by Shawn Brenneman.
* The Asylum Pro is by Steve Sullivan.
* PICT resource 3975 (Ozma) is derived from an illustration by John R. Neill from [Ozma of Oz](https://www.gutenberg.org/files/33361/33361-h/33361-h.htm).
* PICT resource 153 (About box) features a portion of [this Little Nemo comic](http://www.comicstriplibrary.org/display/116) by Winsor McCay.
Aerofoil uses the following third-party software:
@@ -90,3 +119,11 @@ 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)

View 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;
}

View 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>

View File

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

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -62,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);
theErr = CreateOffScreenGWorld(&tempMap, &mapBounds);
LoadGraphicCustom(tempMap, kBannerPageBottomPICT);
theErr = CreateOffScreenGWorld(&tempMask, &mapBounds, GpPixelFormats::kBW1);
LoadGraphic(tempMask, kBannerPageBottomMask);
theErr = CreateOffScreenGWorldCustomDepth(&tempMask, &mapBounds, GpPixelFormats::kBW1);
LoadGraphicCustom(tempMask, kBannerPageBottomMask);
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
(BitMap *)*GetGWorldPixMap(tempMask),
@@ -116,10 +116,6 @@ void DrawBannerMessage (Point topLeft)
Str255 bannerStr, subStr;
short count;
DrawSurface *wasGWorld = GetGraphicsPort();
SetGraphicsPort(workSrcMap);
PasStringCopy((*thisHouse)->banner, bannerStr);
PortabilityLayer::RenderedFont *appFont = GetApplicationFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
@@ -157,8 +153,6 @@ void DrawBannerMessage (Point topLeft)
GetLocalizedString(5, subStr);
workSrcMap->DrawString(Point::Create(topLeft.h + 16, topLeft.v + 180), subStr, redColor, appFont);
}
SetGraphicsPort(wasGWorld);
}
//-------------------------------------------------------------- BringUpBanner
@@ -232,10 +226,10 @@ void DisplayStarsRemaining(void)
NumToString((long)numStarsRemaining, theStr);
if (numStarsRemaining < 2)
LoadScaledGraphic(surface, kStarRemainingPICT, &bounds);
LoadScaledGraphicCustom(surface, kStarRemainingPICT, &bounds);
else
{
LoadScaledGraphic(surface, kStarsRemainingPICT, &bounds);
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);
}

View File

@@ -39,7 +39,6 @@ void BringUpDialog (Dialog **theDialog, short dialogID, const DialogTextSubstitu
// CenterDialog(dialogID);
if (*theDialog == nil)
RedAlert(kErrDialogDidntLoad);
SetGraphicsPort((*theDialog)->GetWindow()->GetDrawSurface());
ShowWindow((*theDialog)->GetWindow());
DrawDefaultButton(*theDialog);
}

View File

@@ -82,7 +82,7 @@ short BackUpToSavedMap (Rect *theRect, SInt16 where, SInt16 who, SInt16 componen
ZeroRectCorner(&mapRect);
savedMaps[numSavedMaps].dest = *theRect;
// CreateOffScreenPixMap(&mapRect, &savedMaps[numSavedMaps].map);
theErr = CreateOffScreenGWorld(&savedMaps[numSavedMaps].map, &mapRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&savedMaps[numSavedMaps].map, &mapRect);
CopyBits((BitMap *)*GetGWorldPixMap(backSrcMap),
GetPortBitMapForCopyBits(savedMaps[numSavedMaps].map),

View File

@@ -31,6 +31,8 @@
#define kDisplay12Inch 2
#define kDisplay13Inch 3
extern Boolean isAutoScale, isUseICCProfile;
typedef struct
{
@@ -207,30 +209,6 @@ Boolean DoWeHaveDragManager (void)
return true;
}
//-------------------------------------------------------------- WhatsOurDepth
// Determines the pixel bit depth for current device (monitor).
short WhatsOurDepth (void)
{
GpPixelFormat_t pixelFormat;
PortabilityLayer::HostDisplayDriver::GetInstance()->GetDisplayResolution(nil, nil, &pixelFormat);
switch (pixelFormat)
{
case GpPixelFormats::k8BitCustom:
case GpPixelFormats::k8BitStandard:
return 8;
case GpPixelFormats::kRGB555:
return 16;
case GpPixelFormats::kRGB24:
case GpPixelFormats::kRGB32:
return 32;
default:
return 0;
}
}
void SwitchToDepth (short, Boolean)
{
}
@@ -321,9 +299,6 @@ void CheckOurEnvirons (void)
thisMac.can4Bit = true;
thisMac.can8Bit = true;
thisMac.numScreens = HowManyUsableScreens(false, true, true);
thisMac.wasDepth = WhatsOurDepth();
thisMac.wasColorOrGray = AreWeColorOrGrayscale();
thisMac.isResolutionDirty = true;
FlushResolutionChange();
@@ -354,15 +329,20 @@ public:
if (physicalHeight < 480)
physicalHeight = 480;
double xMul = static_cast<double>(physicalWidth) / 640;
double yMul = static_cast<double>(physicalHeight) / 480;
double minMul = 1.0;
double granularity = 2.0;
if (isAutoScale)
{
double xMul = static_cast<double>(physicalWidth) / 640.0;
double yMul = static_cast<double>(physicalHeight) / 480.0;
xMul = floor(xMul * granularity) / granularity;
yMul = floor(yMul * granularity) / granularity;
double granularity = 2.0;
double minMul = std::max<double>(1.0, std::min(xMul, yMul));
xMul = floor(xMul * granularity) / granularity;
yMul = floor(yMul * granularity) / granularity;
minMul = std::max<double>(1.0, std::min(xMul, yMul));
}
virtualWidth = physicalWidth / minMul;
virtualHeight = physicalHeight / minMul;
@@ -417,53 +397,23 @@ void ReflectSecondMonitorEnvirons (Boolean use1Bit, Boolean use4Bit, Boolean use
void HandleDepthSwitching (void)
{
if (thisMac.hasColor)
switch (isDepthPref)
{
switch (isDepthPref)
{
case kSwitchIfNeeded:
if ((thisMac.wasDepth != 8) &&
((thisMac.wasDepth != 4) || (thisMac.wasColorOrGray)))
SwitchDepthOrAbort();
break;
case kSwitchTo256Colors:
if (thisMac.wasDepth != 8)
{
if (thisMac.can8Bit)
SwitchToDepth(8, true);
else
SwitchDepthOrAbort();
}
break;
case kSwitchTo16Grays:
if ((thisMac.wasDepth != 4) || (thisMac.wasColorOrGray))
{
if (thisMac.can4Bit)
SwitchToDepth(4, false);
else
SwitchDepthOrAbort();
}
break;
default:
break;
}
case 32:
PortabilityLayer::DisplayDeviceManager::GetInstance()->SetPixelFormat(GpPixelFormats::kRGB32);
break;
case 8:
PortabilityLayer::DisplayDeviceManager::GetInstance()->SetPixelFormat(GpPixelFormats::k8BitStandard);
break;
default:
isDepthPref = 8;
PortabilityLayer::DisplayDeviceManager::GetInstance()->SetPixelFormat(GpPixelFormats::k8BitStandard);
break;
}
thisMac.isDepth = WhatsOurDepth();
}
//-------------------------------------------------------------- RestoreColorDepth
thisMac.isDepth = isDepthPref;
// Restores a monitor to its previous depth when we quit (if we changed it).
void RestoreColorDepth (void)
{
if ((thisMac.hasColor) && ((thisMac.wasDepth != thisMac.isDepth) ||
(thisMac.wasColorOrGray != AreWeColorOrGrayscale())))
SwitchToDepth(thisMac.wasDepth, true);
PortabilityLayer::HostDisplayDriver::GetInstance()->SetUseICCProfile(isUseICCProfile != 0);
}
//-------------------------------------------------------------- CheckMemorySize
@@ -574,7 +524,7 @@ void GetDeviceRect(Rect *rect)
{
unsigned int width;
unsigned int height;
PortabilityLayer::HostDisplayDriver::GetInstance()->GetDisplayResolution(&width, &height, nil);
PortabilityLayer::HostDisplayDriver::GetInstance()->GetDisplayResolution(&width, &height);
SetRect(rect, 0, 0, static_cast<short>(width), static_cast<short>(height));
}

View File

@@ -12,7 +12,7 @@ typedef struct
{
Rect fullScreen, constrainedScreen, gray;
long dirID;
short wasDepth, isDepth;
short isDepth;
short numScreens;
short vRefNum;
Boolean can1Bit;

View File

@@ -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"
@@ -39,7 +37,6 @@ short idleMode;
Boolean doAutoDemo, switchedOut;
extern WindowPtr mapWindow, toolsWindow, linkWindow;
extern WindowPtr menuWindow;
extern short isEditH, isEditV, isMapH, isMapV, isToolsH, isToolsV;
extern short isLinkH, isLinkV, isCoordH, isCoordV;
extern Boolean quitting, isMusicOn, failedMusic;
@@ -387,7 +384,6 @@ void HandleIdleTask (void)
HandleEditorResolutionChange();
}
SetPort(mainWindow->GetDrawSurface());
DoMarquee();
if ((autoRoomEdit) && (newRoomNow))

View File

@@ -21,10 +21,6 @@ namespace PortabilityLayer
class RenderedFont;
}
#define kPreferredDepth 8
#define kPreferredPixelFormat (GpPixelFormats::k8BitStandard)
#define kNilPointer 0L
#define kPutInFront (PL_GetPutInFrontWindowPtr())
#define kNormalUpdates TRUE
@@ -51,6 +47,7 @@ namespace PortabilityLayer
#define kErrNeed16Or256Colors 13
#define iAbout 1
#define iAboutAerofoil 3
#define iNewGame 1
#define iTwoPlayer 2
#define iOpenSavedGame 3
@@ -99,7 +96,6 @@ typedef struct
long wasGPFlipMap;
long wasGPFaceLeftMap, wasGPFaceRightMap;
short wasVolume;
short prefVersion;
short wasMaxFiles;
short wasEditH, wasEditV;
short wasMapH, wasMapV;
@@ -119,14 +115,16 @@ typedef struct
Boolean wasCoordOpen, wasQuickTrans;
Boolean wasIdleMusic, wasGameMusic;
Boolean wasEscPauseKey;
Boolean wasDoAutoDemo, wasScreen2;
Boolean wasDoAutoDemo, wasAutoScale;
Boolean wasDoBackground, wasHouseChecks;
Boolean wasPrettyMap, wasBitchDialogs;
Boolean wasUseICCProfile;
} prefsInfo;
//-------------------------------------------------------------- Prototypes
void DoAbout (void); // --- About.c
void DoAboutFramework (void);
void LoadCursors (void); // --- AnimCursor.c
void DisposCursors (void);
@@ -166,22 +164,21 @@ void DumpToResEditFile (Ptr, long);
void HandleEvent (void); // --- Event.c
void IgnoreThisClick (void);
short WhatsOurDepth (void); // --- Environs.c
void SwitchToDepth (short, Boolean);
void SwitchToDepth (short, Boolean); // --- Environs.c
void CheckOurEnvirons (void);
void InstallResolutionHandler (void);
//void ReflectSecondMonitorEnvirons (Boolean, Boolean, Boolean);
void HandleDepthSwitching (void);
void RestoreColorDepth (void);
void CheckMemorySize (void);
void SetAppMemorySize (long);
Boolean CheckFileError (short, const PLPasStr &); // --- File Error.c
THandle<void> LoadHouseResource(const PortabilityLayer::ResTypeID &resTypeID, int16_t resID); // --- HouseIO.c
Boolean SavePrefs (prefsInfo *, short); // --- Prefs.c
Boolean LoadPrefs (prefsInfo *, short);
Boolean SavePrefs (prefsInfo *, THandle<void> *modulePrefs, short); // --- Prefs.c
Boolean LoadPrefs (prefsInfo *, THandle<void> *modulePrefs, short);
Boolean SaveModulePrefs (THandle<void> currentModulePrefs, THandle<void> *outModulePrefs);
Boolean ApplyModulePrefs (THandle<void> *modulePrefs);
void PasStringCopy (StringPtr, StringPtr); // --- StringUtils.c
short WhichStringFirst (StringPtr, StringPtr);
@@ -235,6 +232,8 @@ void CloseThisWindow (WindowPtr *);
#endif
extern Boolean hasScrap, scrapIsARoom;
#include "GliderDefines.h"
#include "GliderStructs.h"
#include "GliderVars.h"

View File

@@ -7,7 +7,6 @@
#include "PLDialogs.h"
#include "PLNumberFormatting.h"
#include "PLTextUtils.h"
#include "PLPasStr.h"
#include "DialogManager.h"
#include "Externs.h"

View File

@@ -5,7 +5,6 @@
//============================================================================
#include "PLToolUtils.h"
#include "PLPasStr.h"
#include "PLEventQueue.h"
#include "PLKeyEncoding.h"
@@ -71,7 +70,6 @@ void DoGameOver (void)
DrawSurface *surface = mainWindow->GetDrawSurface();
playing = false;
SetUpFinalScreen();
SetPort(mainWindow->GetDrawSurface());
ColorRect(surface, mainWindowRect, 244);
DoGameOverStarAnimation();
if (!TestHighScore())
@@ -163,7 +161,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;
@@ -279,14 +277,14 @@ void InitDiedGameOver (void)
PLError_t theErr;
QSetRect(&pageSrcRect, 0, 0, 25, 32 * 8);
theErr = CreateOffScreenGWorld(&gameOverSrcMap, &pageSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&gameOverSrcMap, &pageSrcRect);
LoadGraphic(gameOverSrcMap, kLettersPictID);
QSetRect(&pageSrcRect, 0, 0, 32, 32 * kPageFrames);
theErr = CreateOffScreenGWorld(&pageSrcMap, &pageSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&pageSrcMap, &pageSrcRect);
LoadGraphic(pageSrcMap, kPagesPictID);
theErr = CreateOffScreenGWorld(&pageMaskMap, &pageSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&pageMaskMap, &pageSrcRect, GpPixelFormats::kBW1);
LoadGraphic(pageMaskMap, kPagesMaskID);
for (i = 0; i < kPageFrames; i++) // initialize src page rects
@@ -465,7 +463,7 @@ void DoDiedGameOver (void)
InitDiedGameOver();
CopyRectMainToWork(&workSrcRect);
CopyRectMainToBack(&workSrcRect);
FlushEvents(everyEvent, 0);
FlushEvents();
nextLoop = TickCount() + 2;
while (pagesStuck < 8)

View File

@@ -41,8 +41,6 @@
#define kYellowCantOrderLinks 24
#define kSwitchIfNeeded 0
#define kSwitchTo256Colors 1
#define kSwitchTo16Grays 2
#define kProdGameScoreMode -4
#define kKickGameScoreMode -3

View File

@@ -435,8 +435,8 @@ void QuickBandsRefresh (Boolean);
void QuickFoilRefresh (Boolean);
void HandleScore (void);
//void PutRoomScrap (void); // --- Scrap.c
//void PutObjectScrap (void);
void PutRoomScrap (void); // --- Scrap.c
void PutObjectScrap (void);
void GetRoomScrap (void);
void GetObjectScrap (void);
//void SeeIfValidScrapAvailable (Boolean);

View File

@@ -185,6 +185,7 @@
<ClCompile Include="RubberBands.cpp" />
<ClCompile Include="SavedGames.cpp" />
<ClCompile Include="Scoreboard.cpp" />
<ClCompile Include="Scrap.cpp" />
<ClCompile Include="SelectHouse.cpp" />
<ClCompile Include="Settings.cpp" />
<ClCompile Include="Sound.cpp" />

View File

@@ -213,6 +213,9 @@
<ClCompile Include="SoundSync_Win32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Scrap.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="SoundSync.h">

View File

@@ -7,6 +7,7 @@
#include "HostDisplayDriver.h"
#include "HostLogDriver.h"
#include "HostSystemServices.h"
#include "HostInputDriver.h"
#include "HostVOSEventQueue.h"
#include "MenuManager.h"
#include "WindowManager.h"
@@ -21,6 +22,7 @@ public:
void PL_Render(IGpDisplayDriver *displayDriver) override;
void PL_HostFileSystem_SetInstance(PortabilityLayer::HostFileSystem *instance) override;
void PL_HostDisplayDriver_SetInstance(IGpDisplayDriver *instance) override;
void PL_HostInputDriver_SetInstances(IGpInputDriver *const* instances, size_t numInstances) override;
void PL_HostSystemServices_SetInstance(PortabilityLayer::HostSystemServices *instance) override;
void PL_HostAudioDriver_SetInstance(IGpAudioDriver *instance) override;
void PL_HostLogDriver_SetInstance(IGpLogDriver *instance) override;
@@ -72,6 +74,11 @@ void GpAppInterfaceImpl::PL_HostAudioDriver_SetInstance(IGpAudioDriver *instance
PortabilityLayer::HostAudioDriver::SetInstance(instance);
}
void GpAppInterfaceImpl::PL_HostInputDriver_SetInstances(IGpInputDriver *const* instances, size_t numInstances)
{
PortabilityLayer::HostInputDriver::SetInstances(instances, numInstances);
}
void GpAppInterfaceImpl::PL_HostFontHandler_SetInstance(PortabilityLayer::HostFontHandler *instance)
{
PortabilityLayer::HostFontHandler::SetInstance(instance);

View File

@@ -270,7 +270,6 @@ void SpillGrease (short who, short index)
void RedrawAllGrease (void)
{
DrawSurface *wasCPort;
Rect src;
short i;
@@ -291,14 +290,10 @@ void RedrawAllGrease (void)
QOffsetRect(&src, playOriginH, playOriginV);
wasCPort = GetGraphicsPort();
backSrcMap->FillRect(src, blackColorBack);
workSrcMap->FillRect(src, blackColorWork);
AddRectToWorkRects(&src);
SetGraphicsPort(wasCPort);
}
}
}

View File

@@ -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"
@@ -74,7 +73,6 @@ void DoHighScores (void)
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
SpinCursor(3);
SetPort(workSrcMap);
workSrcMap->FillRect(workSrcRect, blackColor);
QSetRect(&tempRect, 0, 0, 640, 480);
QOffsetRect(&tempRect, splashOriginH, splashOriginV);
@@ -132,10 +130,10 @@ void DrawHighScores (DrawSurface *surface)
dropIt = 129 + splashOriginV;
QSetRect(&tempRect, 0, 0, 332, 30);
theErr = CreateOffScreenGWorld(&tempMap, &tempRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&tempMap, &tempRect);
LoadGraphic(tempMap, kHighScoresPictID);
theErr = CreateOffScreenGWorld(&tempMask, &tempRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&tempMask, &tempRect, GpPixelFormats::kBW1);
LoadGraphic(tempMask, kHighScoresMaskID);
tempRect2 = tempRect;
@@ -397,7 +395,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)
@@ -434,6 +432,32 @@ void UpdateNameDialog (Dialog *theDialog)
SetDialogNumToStr(theDialog, kNameNCharsItem, (long)nChars);
}
//-------------------------------------------------------------- EventIsTyping
// Checks if a keyboard event should make a typing sound
static bool EventIsTyping(const GpKeyboardInputEvent &kbEvent)
{
if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDownChar || kbEvent.m_eventType == GpKeyboardInputEventTypes::kAutoChar)
{
// Duplicate backspace event
if (kbEvent.m_keyIDSubset == GpKeyIDSubsets::kASCII && kbEvent.m_key.m_asciiChar == '\b')
return false;
return true;
}
if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDown || kbEvent.m_eventType == GpKeyboardInputEventTypes::kAuto)
{
if (kbEvent.m_keyIDSubset == GpKeyIDSubsets::kSpecial)
{
if (kbEvent.m_key.m_specialKey == GpKeySpecials::kBackspace || kbEvent.m_key.m_specialKey == GpKeySpecials::kDelete)
return true;
}
}
return false;
}
//-------------------------------------------------------------- NameFilter
// Dialog filter for the "Enter High Score Name" dialog.
@@ -455,7 +479,7 @@ int16_t NameFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
{
const GpKeyboardInputEvent &kbEvent = evt->m_vosEvent.m_event.m_keyboardInputEvent;
if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDownChar || kbEvent.m_eventType == GpKeyboardInputEventTypes::kAutoChar)
if (EventIsTyping(kbEvent))
{
PlayPrioritySound(kTypingSound, kTypingPriority);
keyStroke = true;
@@ -503,7 +527,7 @@ 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;
@@ -570,7 +594,7 @@ int16_t BannerFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
{
const GpKeyboardInputEvent &kbEvent = evt->m_vosEvent.m_event.m_keyboardInputEvent;
if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDownChar || kbEvent.m_eventType == GpKeyboardInputEventTypes::kAutoChar)
if (EventIsTyping(kbEvent))
{
PlayPrioritySound(kTypingSound, kTypingPriority);
keyStroke = true;

View File

@@ -4,9 +4,7 @@
//----------------------------------------------------------------------------
//============================================================================
#include "PLAppleEvents.h"
#include "PLKeyEncoding.h"
#include "PLNavigation.h"
#include "PLNumberFormatting.h"
#include "PLPasStr.h"
#include "PLResources.h"
@@ -56,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;

View File

@@ -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"

View File

@@ -231,7 +231,6 @@ void DoHouseInfo (void)
houseInfoDialog = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kHouseInfoDialogID, kPutInFront, &substitutions);
if (houseInfoDialog == nil)
RedAlert(kErrDialogDidntLoad);
SetPort(houseInfoDialog->GetWindow()->GetDrawSurface());
ShowWindow(houseInfoDialog->GetWindow());
static_cast<PortabilityLayer::EditboxWidget*>(houseInfoDialog->GetItems()[kBannerTextItem - 1].GetWidget())->SetMultiLine(true);

View File

@@ -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;
@@ -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)

View File

@@ -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);
@@ -154,7 +157,7 @@ void VariableInit (void)
paused = false;
hasMirror = false;
demoGoing = false;
// scrapIsARoom = true;
scrapIsARoom = true;
splashDrawn = false;
#ifndef COMPILEDEMO

View File

@@ -205,7 +205,6 @@ void UpdateLinkWindow (void)
if (linkWindow == nil)
return;
SetPortWindowPort(linkWindow);
UpdateLinkControl();
#endif
}
@@ -379,7 +378,6 @@ void HandleLinkClick (Point wherePt)
if (linkWindow == nil)
return;
SetPortWindowPort(linkWindow);
wherePt -= linkWindow->GetTopLeftCoord();
part = FindControl(wherePt, linkWindow, &theControl);

View File

@@ -15,7 +15,7 @@
#include "WindowManager.h"
#define kPrefsVersion 0x0035
#define kPrefsVersion 0x0038
void ReadInPrefs (void);
@@ -25,7 +25,7 @@ int main(int argc, const char **argv);
short isVolume, wasVolume;
short isDepthPref, dataResFile, numSMWarnings;
Boolean quitting, doZooms, quickerTransitions, isUseSecondScreen;
Boolean quitting, doZooms, quickerTransitions, isAutoScale, isUseICCProfile;
extern Str31 highBanner;
@@ -45,6 +45,8 @@ extern Boolean isMapOpen, isToolsOpen, isCoordOpen;
extern Boolean doPrettyMap, doBitchDialogs;
//extern Boolean didValidation;
THandle<void> globalModulePrefs;
//============================================================== Functions
//-------------------------------------------------------------- ReadInPrefs
@@ -55,8 +57,10 @@ extern Boolean doPrettyMap, doBitchDialogs;
void ReadInPrefs (void)
{
prefsInfo thePrefs;
THandle<void> modulePrefs;
if (LoadPrefs(&thePrefs, kPrefsVersion))
if (LoadPrefs(&thePrefs, &modulePrefs, kPrefsVersion))
{
#ifdef COMPILEDEMO
PasStringCopy("\pDemo House", thisHouseName);
@@ -122,12 +126,18 @@ void ReadInPrefs (void)
toolMode = thePrefs.wasToolGroup;
doAutoDemo = thePrefs.wasDoAutoDemo;
isEscPauseKey = thePrefs.wasEscPauseKey;
isUseSecondScreen = thePrefs.wasScreen2;
if (thisMac.numScreens < 2)
isUseSecondScreen = false;
isAutoScale = thePrefs.wasAutoScale;
isUseICCProfile = thePrefs.wasUseICCProfile;
doBackground = thePrefs.wasDoBackground;
doPrettyMap = thePrefs.wasPrettyMap;
doBitchDialogs = thePrefs.wasBitchDialogs;
if (modulePrefs)
ApplyModulePrefs(&modulePrefs);
globalModulePrefs.Dispose();
globalModulePrefs = modulePrefs;
modulePrefs = nullptr;
}
else
{
@@ -199,10 +209,13 @@ void ReadInPrefs (void)
toolMode = kBlowerMode;
doAutoDemo = true;
isEscPauseKey = false;
isUseSecondScreen = false;
isAutoScale = true;
isUseICCProfile = true;
doBackground = false;
doPrettyMap = false;
doBitchDialogs = true;
modulePrefs.Dispose();
}
if ((numNeighbors > 1) && (thisMac.constrainedScreen.right <= 512))
@@ -291,13 +304,18 @@ void WriteOutPrefs (void)
thePrefs.wasToolGroup = toolMode;
thePrefs.wasDoAutoDemo = doAutoDemo;
thePrefs.wasEscPauseKey = isEscPauseKey;
thePrefs.wasScreen2 = isUseSecondScreen;
thePrefs.wasAutoScale = isAutoScale;
thePrefs.wasUseICCProfile = isUseICCProfile;
thePrefs.wasDoBackground = doBackground;
thePrefs.wasPrettyMap = doPrettyMap;
thePrefs.wasBitchDialogs = doBitchDialogs;
if (!SavePrefs(&thePrefs, kPrefsVersion))
THandle<void> modulePrefs;
if (!SaveModulePrefs(globalModulePrefs, &modulePrefs) || !SavePrefs(&thePrefs, &modulePrefs, kPrefsVersion))
SysBeep(1);
modulePrefs.Dispose();
UnivSetSoundVolume(wasVolume, thisMac.hasSM3);
}
@@ -327,6 +345,9 @@ int gpAppMain()
SetUpAppleEvents();
LoadCursors();
ReadInPrefs();
SpinCursor(2); // Tick once to let the display driver flush any resolution changes from prefs
FlushResolutionChange();
#if defined COMPILEDEMO
copyGood = true;
@@ -341,7 +362,7 @@ int gpAppMain()
else if (didValidation)
WriteOutPrefs(); SpinCursor(3);
#endif
// if ((thisMac.numScreens > 1) && (isUseSecondScreen))
// ReflectSecondMonitorEnvirons(false, true, true);
HandleDepthSwitching();
@@ -395,8 +416,7 @@ int gpAppMain()
}
}
WriteOutPrefs();
RestoreColorDepth();
PL_DEAD(FlushEvents(everyEvent, 0));
PL_DEAD(FlushEvents());
// theErr = LoadScrap();
return 0;

View File

@@ -6,7 +6,6 @@
#include "PLNumberFormatting.h"
#include "PLToolUtils.h"
#include "PLPasStr.h"
#include "Externs.h"
#include "Environ.h"
@@ -55,7 +54,6 @@ extern short toolSelected;
extern Boolean noRoomAtAll, isUseSecondScreen;
extern Boolean quickerTransitions, houseIsReadOnly;
//============================================================== Functions
//-------------------------------------------------------------- DrawOnSplash
@@ -115,8 +113,6 @@ void RedrawSplashScreen (void)
LoadScaledGraphic(surface, kSplash8BitPICT, &tempRect);
DrawOnSplash(surface);
SetPortWindowPort(mainWindow);
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
&workSrcRect, &workSrcRect, srcCopy);
@@ -139,8 +135,6 @@ void UpdateMainWindow (void)
{
Rect tempRect;
SetPortWindowPort(mainWindow);
if (theMode == kEditMode)
{
PauseMarquee();
@@ -160,7 +154,6 @@ void UpdateMainWindow (void)
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
&workSrcRect, &mainWindowRect, srcCopy);
SetPortWindowPort(mainWindow);
DrawOnSplash(mainWindow->GetDrawSurface());
}
@@ -188,7 +181,7 @@ void OpenMainWindow (void)
if (theMode == kEditMode)
{
PortabilityLayer::HostDisplayDriver::GetInstance()->SetBackgroundColor(51, 51, 102, 255);
PortabilityLayer::WindowManager::GetInstance()->SetBackgroundColor(51, 51, 102);
QSetRect(&mainWindowRect, 0, 0, 512, 322);
mainWindow = GetNewCWindow(kEditWindowID, nil, kPutInFront);
@@ -214,9 +207,9 @@ void OpenMainWindow (void)
else
{
#ifdef NDEBUG
PortabilityLayer::HostDisplayDriver::GetInstance()->SetBackgroundColor(0, 0, 0, 255);
PortabilityLayer::WindowManager::GetInstance()->SetBackgroundColor(0, 0, 0);
#else
PortabilityLayer::HostDisplayDriver::GetInstance()->SetBackgroundColor(51, 0, 0, 255);
PortabilityLayer::WindowManager::GetInstance()->SetBackgroundColor(51, 0, 0);
#endif
if (boardWindow == nil)
@@ -232,6 +225,9 @@ void OpenMainWindow (void)
windowManager->PutWindowBehind(boardWindow, PL_GetPutInFrontWindowPtr());
else
PL_NotYetImplemented_TODO("Errors");
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
boardWindow->GetDrawSurface()->FillRect(boardWindow->GetSurfaceRect(), blackColor);
}
mainWindowRect = thisMac.constrainedScreen;
ZeroRectCorner(&mainWindowRect);
@@ -246,7 +242,6 @@ void OpenMainWindow (void)
MoveWindow(boardWindow, mainWindowLeft, 0, true);
MoveWindow(mainWindow, mainWindowLeft, mainWindowTop, true); // thisMac.menuHigh
ShowWindow(mainWindow);
SetPortWindowPort(mainWindow);
DrawSurface *mainWindowSurface = mainWindow->GetDrawSurface();
@@ -273,7 +268,6 @@ void OpenMainWindow (void)
// ForceCTSeed((CGrafPtr)mainWindow, wasSeed);
// }
SetPortWindowPort(mainWindow);
UpdateMainWindow();
}
@@ -371,7 +365,6 @@ void HandleMainClick (Point wherePt, Boolean isDoubleClick)
(!houseUnlocked))
return;
SetPortWindowPort(mainWindow);
wherePt -= mainWindow->GetTopLeftCoord();
DrawSurface *mainWindowSurface = mainWindow->GetDrawSurface();

View File

@@ -327,7 +327,6 @@ void UpdateMapWindow (void)
mapWindow->DrawControls();
SetPortWindowPort(mapWindow);
// PL_NotYetImplemented_TODO("Resize")
RedrawMapContents();
@@ -411,7 +410,6 @@ void OpenMapWindow (void)
PortabilityLayer::WindowManager::GetInstance()->ShowWindow(mapWindow);
// FlagWindowFloating(mapWindow); TEMP - use flaoting windows
SetPort(mapWindow->GetDrawSurface());
QSetRect(&mapHScrollRect, -1, mapRoomsHigh * kMapRoomHeight,
mapRoomsWide * kMapRoomWidth + 1,
mapRoomsHigh * kMapRoomHeight + kMapScrollBarWidth);
@@ -619,7 +617,6 @@ void HandleMapClick (const GpMouseInputEvent &theEvent)
if (mapWindow == nil)
return;
SetPortWindowPort(mapWindow);
globalWhere = wherePt;
wherePt -= mapWindow->GetTopLeftCoord();
wherePt.h -= 1;
@@ -645,7 +642,6 @@ void HandleMapClick (const GpMouseInputEvent &theEvent)
if (thisMac.hasDrag)
{
SetPortWindowPort(mainWindow);
QSetRect(&aRoom, 0, 0, kMapRoomWidth, kMapRoomHeight);
CenterRectOnPoint(&aRoom, globalWhere);
// if (DragRoom(theEvent, &aRoom, itsNumber))
@@ -762,7 +758,7 @@ void CreateNailOffscreen (void)
if (nailSrcMap == nil)
{
QSetRect(&nailSrcRect, 0, 0, kMapRoomWidth, kMapRoomHeight * (kNumBackgrounds + 1));
theErr = CreateOffScreenGWorld(&nailSrcMap, &nailSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&nailSrcMap, &nailSrcRect);
LoadGraphic(nailSrcMap, kThumbnailPictID);
}

View File

@@ -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"
@@ -199,21 +198,21 @@ void UpdateClipboardMenus (void)
mm->SetItemEnabled(houseMenu, iCut - 1, true);
mm->SetItemEnabled(houseMenu, iCopy - 1, true);
// if (hasScrap)
// {
// EnableMenuItem(houseMenu, iPaste);
// if (scrapIsARoom)
// {
// GetLocalizedString(42, title);
// SetMenuItemText(houseMenu, iPaste, title);
// }
// else
// {
// GetLocalizedString(43, title);
// SetMenuItemText(houseMenu, iPaste, title);
// }
// }
// else
if (hasScrap)
{
EnableMenuItem(houseMenu, iPaste);
if (scrapIsARoom)
{
GetLocalizedString(42, title);
SetMenuItemText(houseMenu, iPaste, title);
}
else
{
GetLocalizedString(43, title);
SetMenuItemText(houseMenu, iPaste, title);
}
}
else
{
mm->SetItemEnabled(houseMenu, iPaste - 1, false);
GetLocalizedString(44, title);
@@ -294,6 +293,10 @@ void DoAppleMenu (short theItem)
DoAbout();
break;
case iAboutAerofoil:
DoAboutFramework();
break;
default:
// GetMenuItemText(appleMenu, theItem, daName);
// GetPort(&wasPort);
@@ -457,6 +460,7 @@ void DoHouseMenu (short theItem)
if (CreateNewHouse())
{
whoCares = InitializeEmptyHouse();
whoCares = WriteHouse(false); // Save initial house so it's not an empty file if reloaded immediately
OpenCloseEditWindows();
}
break;
@@ -512,12 +516,12 @@ void DoHouseMenu (short theItem)
{
if (objActive > kNoObjectSelected)
{
// PutObjectScrap();
PutObjectScrap();
DeleteObject();
}
else
{
// PutRoomScrap();
PutRoomScrap();
DeleteRoom(false);
}
UpdateClipboardMenus();
@@ -527,10 +531,10 @@ void DoHouseMenu (short theItem)
case iCopy:
if (houseUnlocked)
{
// if (objActive > kNoObjectSelected)
// PutObjectScrap();
// else
// PutRoomScrap();
if (objActive > kNoObjectSelected)
PutObjectScrap();
else
PutRoomScrap();
UpdateClipboardMenus();
}
break;
@@ -538,12 +542,11 @@ void DoHouseMenu (short theItem)
case iPaste:
if (houseUnlocked)
{
/* if (scrapIsARoom)
if (scrapIsARoom)
GetRoomScrap();
else
GetObjectScrap();
UpdateClipboardMenus();
*/
}
break;

View File

@@ -6,7 +6,6 @@
//============================================================================
#include "PLToolUtils.h"
#include "PLKeyEncoding.h"
#include "DialogManager.h"
#include "Externs.h"

View File

@@ -613,8 +613,7 @@ void DrawDresser(Rect *dresser)
short nRects, height, i;
Pattern dummyPattern;
DrawSurface *surface = reinterpret_cast<DrawSurface*>(PortabilityLayer::QDManager::GetInstance()->GetPort());
//surface = backSrcMap;
DrawSurface *surface = backSrcMap;
if (thisMac.isDepth == 4)
{

View File

@@ -7,7 +7,6 @@
#include "BitmapImage.h"
#include "PLResources.h"
#include "PLTextUtils.h"
#include "PLPasStr.h"
#include "Externs.h"
#include "FontFamily.h"
@@ -170,10 +169,10 @@ void DrawMailboxLeft (Rect *theRect, short down)
}
bounds = srcRects[kMailboxLf];
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&tempMap, &bounds);
LoadGraphic(tempMap, kMailboxLeftPictID);
theErr = CreateOffScreenGWorld(&tempMask, &bounds, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&tempMask, &bounds, GpPixelFormats::kBW1);
LoadGraphic(tempMask, kMailboxLeftMaskID);
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
@@ -242,10 +241,10 @@ void DrawMailboxRight (Rect *theRect, short down)
}
bounds = srcRects[kMailboxRt];
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&tempMap, &bounds);
LoadGraphic(tempMap, kMailboxRightPictID);
theErr = CreateOffScreenGWorld(&tempMask, &bounds, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&tempMask, &bounds, GpPixelFormats::kBW1);
LoadGraphic(tempMask, kMailboxRightMaskID);
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
@@ -605,10 +604,10 @@ void DrawTV (Rect *theRect, Boolean isOn, Boolean isLit)
if (isLit)
{
bounds = srcRects[kTV];
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&tempMap, &bounds);
LoadGraphic(tempMap, kTVPictID);
theErr = CreateOffScreenGWorld(&tempMask, &bounds, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&tempMask, &bounds, GpPixelFormats::kBW1);
LoadGraphic(tempMask, kTVMaskID);
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
@@ -691,10 +690,10 @@ void DrawVCR (Rect *theRect, Boolean isOn, Boolean isLit)
if (isLit)
{
bounds = srcRects[kVCR];
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&tempMap, &bounds);
LoadGraphic(tempMap, kVCRPictID);
theErr = CreateOffScreenGWorld(&tempMask, &bounds, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&tempMask, &bounds, GpPixelFormats::kBW1);
LoadGraphic(tempMask, kVCRMaskID);
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
@@ -738,10 +737,10 @@ void DrawStereo (Rect *theRect, Boolean isOn, Boolean isLit)
if (isLit)
{
bounds = srcRects[kStereo];
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&tempMap, &bounds);
LoadGraphic(tempMap, kStereoPictID);
theErr = CreateOffScreenGWorld(&tempMask, &bounds, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&tempMask, &bounds, GpPixelFormats::kBW1);
LoadGraphic(tempMask, kStereoMaskID);
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
@@ -785,10 +784,10 @@ void DrawMicrowave (Rect *theRect, Boolean isOn, Boolean isLit)
if (isLit)
{
bounds = srcRects[kMicrowave];
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&tempMap, &bounds);
LoadGraphic(tempMap, kMicrowavePictID);
theErr = CreateOffScreenGWorld(&tempMask, &bounds, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&tempMask, &bounds, GpPixelFormats::kBW1);
LoadGraphic(tempMask, kMicrowaveMaskID);
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
@@ -1047,10 +1046,6 @@ void DrawCalendar (Rect *theRect)
Rect bounds;
THandle<BitmapImage> thePicture;
Str255 monthStr;
DrawSurface *wasCPort;
wasCPort = GetGraphicsPort();
SetGraphicsPort(backSrcMap);
thePicture = PortabilityLayer::ResourceManager::GetInstance()->GetAppResource('PICT', kCalendarPictID).StaticCast<BitmapImage>();
if (thePicture == nil)
@@ -1163,10 +1158,10 @@ void DrawPictWithMaskObject (short what, Rect *theRect)
}
bounds = srcRects[what];
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&tempMap, &bounds);
LoadGraphic(tempMap, pictID);
theErr = CreateOffScreenGWorld(&tempMask, &bounds, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&tempMask, &bounds, GpPixelFormats::kBW1);
LoadGraphic(tempMask, maskID);
CopyMask((BitMap *)*GetGWorldPixMap(tempMap),
@@ -1274,7 +1269,7 @@ void DrawPictSansWhiteObject (short what, Rect *theRect)
}
bounds = srcRects[what];
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&tempMap, &bounds);
LoadGraphic(tempMap, pictID);
CopyBits((BitMap *)*GetGWorldPixMap(tempMap),
@@ -1294,7 +1289,7 @@ void DrawCustPictSansWhite (short pictID, Rect *theRect)
bounds = *theRect;
ZeroRectCorner(&bounds);
theErr = CreateOffScreenGWorld(&tempMap, &bounds, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&tempMap, &bounds);
LoadGraphicCustom(tempMap, pictID);
CopyBits((BitMap *)*GetGWorldPixMap(tempMap),

View File

@@ -6,7 +6,6 @@
#include "PLKeyEncoding.h"
#include "PLSound.h"
#include "PLToolUtils.h"
#include "PLPasStr.h"
#include "BitmapImage.h"
#include "Externs.h"

View File

@@ -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"
@@ -737,7 +736,6 @@ void DoBlowerObjectInfo (short what)
infoDial = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kBlowerInfoDialogID, kPutInFront, &substitutions);
if (infoDial == nil)
RedAlert(kErrDialogDidntLoad);
SetPort(infoDial->GetWindow()->GetDrawSurface());
newDirection = thisRoom->objects[objActive].data.a.vector & 0x0F;
if (thisRoom->objects[objActive].data.a.initial)
@@ -1354,7 +1352,6 @@ void DoLightObjectInfo (void)
infoDial = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kLightInfoDialogID, kPutInFront, &substitutions);
if (infoDial == nil)
RedAlert(kErrDialogDidntLoad);
SetPort(infoDial->GetWindow()->GetDrawSurface());
if (thisRoom->objects[objActive].data.f.initial)
SetDialogItemValue(infoDial, kInitialStateCheckbox, 1);

View File

@@ -247,7 +247,6 @@ void NewGame (short mode)
StopTheMusic();
}
NilSavedMaps();
SetPortWindowPort(mainWindow);
UpdateMenus(false);

View File

@@ -10,25 +10,42 @@
#include "Externs.h"
#include "Environ.h"
#include "FileManager.h"
#include "IGpAudioDriver.h"
#include "IGpDisplayDriver.h"
#include "IGpInputDriver.h"
#include "IGpPrefsHandler.h"
#include "IOStream.h"
#include "MemoryManager.h"
#include "HostAudioDriver.h"
#include "HostDisplayDriver.h"
#include "HostInputDriver.h"
#define kPrefCreatorType 'ozm5'
#define kPrefFileType 'gliP'
#define kPrefFileName PSTR("Glider Prefs")
#define kPrefFileName PSTR("Glider Prefs v2")
#define kDefaultPrefFName PSTR("Preferences")
#define kPrefsStringsID 160
#define kNewPrefsAlertID 160
#define kPrefsFNameIndex 1
typedef struct modulePrefsListEntry
{
THandle<char> m_identifier;
THandle<uint8_t> m_contents;
uint32_t m_version;
} modulePrefsListEntry;
Boolean CanUseFindFolder (void);
Boolean WritePrefs (const prefsInfo *);
PLError_t ReadPrefs (prefsInfo *);
Boolean WritePrefs (const prefsInfo *, short versionNow, THandle<modulePrefsListEntry> *theModulePrefs);
PLError_t ReadPrefs (prefsInfo *thePrefs, short versionNeed, Boolean *isOldVersion, THandle<modulePrefsListEntry> *theModulePrefs);
Boolean DeletePrefs ();
void BringUpDeletePrefsAlert (void);
THandle<modulePrefsListEntry> theModulePrefs;
//============================================================== Functions
//-------------------------------------------------------------- CanUseFindFolder
@@ -39,7 +56,7 @@ Boolean CanUseFindFolder (void)
//-------------------------------------------------------------- WritePrefs
Boolean WritePrefs (const prefsInfo *thePrefs)
Boolean WritePrefs (const prefsInfo *thePrefs, short versionNow, THandle<modulePrefsListEntry> modulePrefs)
{
PLError_t theErr;
PortabilityLayer::IOStream *fileStream;
@@ -66,15 +83,70 @@ Boolean WritePrefs (const prefsInfo *thePrefs)
CheckFileError(theErr, PSTR("Preferences"));
return(false);
}
uint32_t version = versionNow;
if (fileStream->Write(&version, sizeof(version)) != sizeof(version))
{
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(false);
}
byteCount = sizeof(*thePrefs);
if (fileStream->Write(thePrefs, byteCount) != byteCount)
{
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(false);
}
uint32_t numEntries = 0;
if (modulePrefs)
numEntries = modulePrefs.MMBlock()->m_size / sizeof(modulePrefsListEntry);
if (fileStream->Write(&numEntries, sizeof(numEntries)) != sizeof(numEntries))
{
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(false);
}
for (uint32_t i = 0; i < numEntries; i++)
{
modulePrefsListEntry *entry = (*modulePrefs) + i;
uint32_t version = entry->m_version;
if (fileStream->Write(&version, sizeof(version)) != sizeof(version))
{
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(false);
}
THandle<void> handles[2] = { entry->m_identifier.StaticCast<void>(), entry->m_contents.StaticCast<void>() };
for (int hi = 0; hi < 2; hi++)
{
uint32_t hSize = handles[hi].MMBlock()->m_size;
if (fileStream->Write(&hSize, sizeof(hSize)) != sizeof(hSize))
{
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(false);
}
if (fileStream->Write(*handles[hi], hSize) != hSize)
{
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(false);
}
}
}
fileStream->Close();
return(true);
@@ -82,19 +154,39 @@ Boolean WritePrefs (const prefsInfo *thePrefs)
//-------------------------------------------------------------- SavePrefs
Boolean SavePrefs (prefsInfo *thePrefs, short versionNow)
Boolean SavePrefs (prefsInfo *thePrefs, THandle<void> *modulePrefs, short versionNow)
{
thePrefs->prefVersion = versionNow;
if (!WritePrefs(thePrefs))
if (!WritePrefs(thePrefs, versionNow, modulePrefs->StaticCast<modulePrefsListEntry>()))
return(false);
return(true);
}
static void DestroyModulePrefs(THandle<modulePrefsListEntry> *theModulePrefs)
{
if (!*theModulePrefs)
return;
modulePrefsListEntry *firstOldEntry = **theModulePrefs;
if (!firstOldEntry)
return;
size_t numOldPrefs = theModulePrefs->MMBlock()->m_size / sizeof(modulePrefsListEntry);
for (size_t i = 0; i < numOldPrefs; i++)
{
firstOldEntry[i].m_contents.Dispose();
firstOldEntry[i].m_identifier.Dispose();
firstOldEntry[i].~modulePrefsListEntry();
}
theModulePrefs->Dispose();
}
//-------------------------------------------------------------- ReadPrefs
PLError_t ReadPrefs (prefsInfo *thePrefs)
PLError_t ReadPrefs (prefsInfo *thePrefs, short versionNeed, Boolean *isOldVersion, THandle<modulePrefsListEntry> *theModulePrefs)
{
PLError_t theErr;
PortabilityLayer::IOStream *fileStream;
@@ -102,6 +194,8 @@ PLError_t ReadPrefs (prefsInfo *thePrefs)
VFileSpec theSpecs;
Str255 fileName;
*isOldVersion = false;
PortabilityLayer::FileManager *fm = PortabilityLayer::FileManager::GetInstance();
PasStringCopy(kPrefFileName, fileName);
@@ -117,6 +211,21 @@ PLError_t ReadPrefs (prefsInfo *thePrefs)
CheckFileError(theErr, PSTR("Preferences"));
return(theErr);
}
uint32_t version = 0;
if (fileStream->Read(&version, sizeof(version)) != sizeof(version))
{
CheckFileError(theErr, PSTR("Preferences"));
fileStream->Close();
return(PLErrors::kIOError);
}
if (version != versionNeed)
{
*isOldVersion = true;
fileStream->Close();
return(PLErrors::kNone);
}
byteCount = sizeof(*thePrefs);
@@ -124,7 +233,81 @@ PLError_t ReadPrefs (prefsInfo *thePrefs)
{
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(theErr);
return(PLErrors::kIOError);
}
uint32_t numModulePrefs = 0;
if (fileStream->Read(&numModulePrefs, sizeof(numModulePrefs)) != sizeof(numModulePrefs))
{
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(PLErrors::kIOError);
}
DestroyModulePrefs(theModulePrefs);
if (numModulePrefs)
{
PortabilityLayer::MemoryManager *mm = PortabilityLayer::MemoryManager::GetInstance();
*theModulePrefs = THandle<modulePrefsListEntry>(mm->AllocHandle(numModulePrefs * sizeof(modulePrefsListEntry)));
if (!*theModulePrefs)
{
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(PLErrors::kIOError);
}
modulePrefsListEntry *firstNewEntry = **theModulePrefs;
for (size_t i = 0; i < numModulePrefs; i++)
new (firstNewEntry + i) modulePrefsListEntry();
for (uint32_t i = 0; i < numModulePrefs; i++)
{
if (fileStream->Read(&firstNewEntry[i].m_version, sizeof(firstNewEntry[i].m_version)) != sizeof(firstNewEntry[i].m_version))
{
DestroyModulePrefs(theModulePrefs);
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(PLErrors::kIOError);
}
for (int subHandle = 0; subHandle < 2; subHandle++)
{
uint32_t handleSz;
if (fileStream->Read(&handleSz, sizeof(handleSz)) != sizeof(handleSz))
{
DestroyModulePrefs(theModulePrefs);
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(PLErrors::kIOError);
}
PortabilityLayer::MMHandleBlock *mmBlock = mm->AllocHandle(handleSz);
if (!mmBlock)
{
DestroyModulePrefs(theModulePrefs);
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(PLErrors::kIOError);
}
if (subHandle == 0)
firstNewEntry[i].m_identifier = THandle<char>(mmBlock);
else
firstNewEntry[i].m_contents = THandle<uint8_t>(mmBlock);
if (fileStream->Read(mmBlock->m_contents, handleSz) != handleSz)
{
DestroyModulePrefs(theModulePrefs);
CheckFileError(PLErrors::kIOError, PSTR("Preferences"));
fileStream->Close();
return(PLErrors::kIOError);
}
}
}
}
fileStream->Close();
@@ -147,14 +330,42 @@ Boolean DeletePrefs ()
return PortabilityLayer::FileManager::GetInstance()->DeleteFile(theSpecs.m_dir, theSpecs.m_name);
}
//-------------------------------------------------------------- RunFunctionOnAllPrefsHandlers
bool RunFunctionOnAllPrefsHandlers (void *context, bool (*func) (void *context, IGpPrefsHandler *handler))
{
IGpPrefsHandler *ddHandler = PortabilityLayer::HostDisplayDriver::GetInstance()->GetPrefsHandler();
if (ddHandler && !func(context, ddHandler))
return false;
IGpPrefsHandler *adHandler = PortabilityLayer::HostAudioDriver::GetInstance()->GetPrefsHandler();
if (adHandler && !func(context, adHandler))
return false;
size_t numInputDrivers = PortabilityLayer::HostInputDriver::NumInstances();
for (size_t i = 0; i < numInputDrivers; i++)
{
IGpPrefsHandler *idHandler = PortabilityLayer::HostInputDriver::GetInstance(i)->GetPrefsHandler();
if (idHandler && !func(context, idHandler))
return false;
}
return true;
}
//-------------------------------------------------------------- LoadPrefs
Boolean LoadPrefs (prefsInfo *thePrefs, short versionNeed)
Boolean LoadPrefs (prefsInfo *thePrefs, THandle<void> *modulePrefs, short versionNeed)
{
PLError_t theErr;
Boolean noProblems;
Boolean isOldVersion = 0;
THandle<modulePrefsListEntry> mPrefs;
theErr = ReadPrefs(thePrefs);
theErr = ReadPrefs(thePrefs, versionNeed, &isOldVersion, &mPrefs);
if (theErr == PLErrors::kFileNotFound)
return (false);
@@ -165,19 +376,164 @@ Boolean LoadPrefs (prefsInfo *thePrefs, short versionNeed)
noProblems = DeletePrefs();
return (false);
}
if (thePrefs->prefVersion != versionNeed)
if (isOldVersion)
{
BringUpDeletePrefsAlert();
noProblems = DeletePrefs();
return(false);
}
*modulePrefs = mPrefs.StaticCast<void>();
return (true);
}
//-------------------------------------------------------------- BringUpDeletePrefsAlert
static THandle<void> CloneHandle(THandle<void> hdl)
{
if (!hdl)
return THandle<void>();
PortabilityLayer::MMHandleBlock *newHdl = PortabilityLayer::MemoryManager::GetInstance()->AllocHandle(hdl.MMBlock()->m_size);
if (!newHdl)
return THandle<void>();
memcpy(newHdl->m_contents, hdl.MMBlock()->m_contents, hdl.MMBlock()->m_size);
return THandle<void>(newHdl);
}
struct SaveModulePrefsContext
{
size_t m_numModulePrefs;
THandle<modulePrefsListEntry> m_newPrefs;
};
bool SaveModulePrefsWriteFunc(void *vcontext, const void *identifier, size_t identifierSize, const void *contents, size_t contentsSize, uint32_t version)
{
PortabilityLayer::MemoryManager *mm = PortabilityLayer::MemoryManager::GetInstance();
SaveModulePrefsContext *context = static_cast<SaveModulePrefsContext*>(vcontext);
modulePrefsListEntry *saveToEntry = nullptr;
for (size_t i = 0; i < context->m_numModulePrefs; i++)
{
modulePrefsListEntry *checkEntry = (*context->m_newPrefs) + i;
THandle<char> candidateIdentHdl = checkEntry->m_identifier;
size_t candidateIdentSize = candidateIdentHdl.MMBlock()->m_size;
if (candidateIdentSize == identifierSize && !memcmp(*candidateIdentHdl, identifier, candidateIdentSize))
{
saveToEntry = checkEntry;
break;
}
}
if (!saveToEntry)
{
if (context->m_numModulePrefs == 0)
context->m_newPrefs = THandle<modulePrefsListEntry>(mm->AllocHandle(sizeof(modulePrefsListEntry)));
else
mm->ResizeHandle(context->m_newPrefs.MMBlock(), (context->m_numModulePrefs + 1) * sizeof(modulePrefsListEntry));
saveToEntry = (*context->m_newPrefs) + context->m_numModulePrefs;
new (saveToEntry) modulePrefsListEntry();
context->m_numModulePrefs++;
}
if (saveToEntry->m_contents)
saveToEntry->m_contents.Dispose();
if (!saveToEntry->m_identifier)
{
saveToEntry->m_identifier = THandle<char>(mm->AllocHandle(identifierSize));
memcpy(*saveToEntry->m_identifier, identifier, identifierSize);
}
saveToEntry->m_contents = THandle<uint8_t>(mm->AllocHandle(contentsSize));
memcpy(*saveToEntry->m_contents, contents, contentsSize);
saveToEntry->m_version = version;
return true;
}
bool SaveModulePrefsCallback(void *vcontext, IGpPrefsHandler *handler)
{
return handler->SavePrefs(vcontext, SaveModulePrefsWriteFunc);
}
Boolean SaveModulePrefs(THandle<void> currentModulePrefs, THandle<void> *outModulePrefs)
{
SaveModulePrefsContext context;
size_t numModulePrefs = 0;
THandle<modulePrefsListEntry> newPrefs;
if (currentModulePrefs)
{
numModulePrefs = currentModulePrefs.MMBlock()->m_size / sizeof(modulePrefsListEntry);
newPrefs = CloneHandle(currentModulePrefs).StaticCast<modulePrefsListEntry>();
modulePrefsListEntry *entries = *newPrefs;
for (size_t i = 0; i < numModulePrefs; i++)
{
entries[i].m_contents = CloneHandle(entries[i].m_contents.StaticCast<void>()).StaticCast<uint8_t>();
entries[i].m_identifier = CloneHandle(entries[i].m_identifier.StaticCast<void>()).StaticCast<char>();
}
}
else
newPrefs = THandle<modulePrefsListEntry>(PortabilityLayer::MemoryManager::GetInstance()->AllocHandle(0));
context.m_newPrefs = newPrefs;
context.m_numModulePrefs = numModulePrefs;
bool savedOK = RunFunctionOnAllPrefsHandlers(&context, SaveModulePrefsCallback);
if (savedOK)
{
outModulePrefs->Dispose();
*outModulePrefs = context.m_newPrefs.StaticCast<void>();
}
return savedOK;
}
//-------------------------------------------------------------- BringUpDeletePrefsAlert
struct ApplyModulePrefsContext
{
size_t m_numModulePrefs;
THandle<modulePrefsListEntry> m_newPrefs;
};
bool ApplyModulePrefsCallback(void *vcontext, IGpPrefsHandler *handler)
{
ApplyModulePrefsContext *context = static_cast<ApplyModulePrefsContext*>(vcontext);
const modulePrefsListEntry *entries = *(context->m_newPrefs);
for (size_t i = 0; i < context->m_numModulePrefs; i++)
handler->ApplyPrefs(*entries[i].m_identifier, entries[i].m_identifier.MMBlock()->m_size, *entries[i].m_contents, entries[i].m_contents.MMBlock()->m_size, entries[i].m_version);
return true;
}
Boolean ApplyModulePrefs (THandle<void> *modulePrefs)
{
ApplyModulePrefsContext context;
context.m_newPrefs = modulePrefs->StaticCast<modulePrefsListEntry>();
context.m_numModulePrefs = context.m_newPrefs.MMBlock()->m_size / sizeof(modulePrefsListEntry);
return RunFunctionOnAllPrefsHandlers(&context, ApplyModulePrefsCallback);
}
//-------------------------------------------------------------- BringUpDeletePrefsAlert
void BringUpDeletePrefsAlert (void)
{
short whoCares;

View File

@@ -147,8 +147,6 @@ void DrawReflection (gliderPtr thisGlider, Boolean oneOrTwo)
dest = thisGlider->dest;
QOffsetRect(&dest, playOriginH - 20, playOriginV - 16);
SetPort(workSrcMap);
long numMirrorRects = GetHandleSize(mirrorRects.StaticCast<void>()) / sizeof(Rect);
for (long i = 0; i < numMirrorRects; i++)

View File

@@ -6,7 +6,6 @@
#include "PLKeyEncoding.h"
#include "PLResources.h"
#include "PLToolUtils.h"
#include "PLPasStr.h"
#include "PLStandardColors.h"
#include "BitmapImage.h"

View File

@@ -80,7 +80,6 @@ void ResetLocale (Boolean soft)
takingTheStairs = false;
DrawSurface *wasCPort = GetGraphicsPort();
const short roomV = (*thisHouse)->rooms[thisRoomNumber].floor;
PortabilityLayer::ResolveCachingColor blackColor = StdColors::Black();
@@ -138,8 +137,6 @@ void ResetLocale (Boolean soft)
if (soft)
RedrawAllGrease();
SetGraphicsPort(wasCPort);
}
//-------------------------------------------------------------- LoadGraphicSpecial

View File

@@ -436,7 +436,7 @@ void DoRoomInfo(void)
NumToString(thisRoom->numObjects, objectsStr);
DialogTextSubstitutions substitutions(floorStr, suiteStr, objectsStr);
theErr = CreateOffScreenGWorld(&tileSrcMap, &tileSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&tileSrcMap, &tileSrcRect);
// CreateOffScreenPixMap(&tileSrcRect, &tileSrcMap);
// SetPort((GrafPtr)tileSrcMap);
if ((tempBack > kStars) && (!PictIDExists(tempBack)))
@@ -457,7 +457,6 @@ void DoRoomInfo(void)
roomInfoDialog = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kRoomInfoDialogID, kPutInFront, &substitutions);
if (roomInfoDialog == nil)
RedAlert(kErrDialogDidntLoad);
SetPort(roomInfoDialog->GetWindow()->GetDrawSurface());
{
PortabilityLayer::WidgetBasicState state;

View File

@@ -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;

File diff suppressed because one or more lines are too long

547
GpApp/Scrap.cpp Normal file
View File

@@ -0,0 +1,547 @@
//============================================================================
//----------------------------------------------------------------------------
// Scrap.c
//----------------------------------------------------------------------------
//============================================================================
#include "Externs.h"
#include "Environ.h"
#include "MemoryManager.h"
Boolean hasScrap, scrapIsARoom;
extern WindowPtr mapWindow;
extern Rect roomObjectRects[];
extern short objActive;
//============================================================== Functions
THandle<void> scrapData;
int32_t scrapType;
PLError_t ZeroScrap()
{
scrapType = 0;
scrapData.Dispose();
scrapData = nullptr;
return PLErrors::kNone;
}
PLError_t PutScrap(size_t size, int32_t typeID, const void *data)
{
scrapData.Dispose();
if (size)
{
scrapData = THandle<void>(PortabilityLayer::MemoryManager::GetInstance()->AllocHandle(size));
if (!scrapData)
return PLErrors::kOutOfMemory;
memcpy(*scrapData, data, size);
}
scrapType = typeID;
return PLErrors::kNone;
}
PLError_t GetScrap(THandle<void> destHdl, int32_t typeID, long *outSize)
{
if (scrapType != typeID || !scrapData)
return PLErrors::kInvalidParameter;
size_t scrapSize = scrapData.MMBlock()->m_size;
if (scrapSize)
{
PortabilityLayer::MemoryManager::GetInstance()->ResizeHandle(destHdl.MMBlock(), scrapSize);
memcpy(*destHdl, *scrapData, scrapSize);
}
return PLErrors::kNone;
}
//-------------------------------------------------------------- PutRoomScrap
#ifndef COMPILEDEMO
void PutRoomScrap (void)
{
// this function copies the current room into the clipboard
Rect largeBounds, smallBounds;
PLError_t theErr;
theErr = ZeroScrap();
if (theErr == PLErrors::kNone)
{
SetRect(&largeBounds, 0, 0, kRoomWide, kTileHigh);
SetRect(&smallBounds, 0, 0, kRoomWide / 4, kTileHigh / 4);
theErr = PutScrap(sizeof(roomType), 'Room', (Ptr)thisRoom);
if (theErr == PLErrors::kNone)
{
if (!hasScrap)
{
hasScrap = true;
UpdateMenus(false);
}
scrapIsARoom = true;
}
else
YellowAlert(kYellowScrapError, theErr);
}
else
YellowAlert(kYellowScrapError, theErr);
}
#endif
//-------------------------------------------------------------- PutObjectScrap
#ifndef COMPILEDEMO
void PutObjectScrap (void)
{
// this function copies the currently selected object into the clipboard
Str255 kindStr;
objectPtr scrapObjPtr;
long theErr;
theErr = ZeroScrap();
if (theErr == PLErrors::kNone)
{
scrapObjPtr = &(thisRoom->objects[objActive]);
theErr = PutScrap(sizeof(objectType), 'Obj.', (Ptr)scrapObjPtr);
if (theErr == PLErrors::kNone)
{
if (!hasScrap)
{
hasScrap = true;
UpdateMenus(false);
}
scrapIsARoom = false;
}
else
YellowAlert(kYellowScrapError, theErr);
}
else
YellowAlert(kYellowScrapError, theErr);
}
#endif
//-------------------------------------------------------------- GetRoomScrap
#ifndef COMPILEDEMO
void GetRoomScrap (void)
{
// this function pastes a room from the clipboard
Handle tempRoom;
long theErr, scrapOffset;
short wasFloor, wasSuite, srcRoomNumber, destRoomNumber, i;
short linkRoomNumber;
tempRoom = NewHandle(0L);
if (tempRoom == nil)
{
YellowAlert(kYellowNoMemory, 0);
return;
}
theErr = GetScrap(tempRoom, 'Room', &scrapOffset);
if (theErr < 0)
YellowAlert(kYellowScrapError, theErr);
else
{
DeselectObject();
wasFloor = thisRoom->floor;
wasSuite = thisRoom->suite;
destRoomNumber = GetRoomNumber(thisRoom->floor, thisRoom->suite);
memcpy(thisRoom, *tempRoom, sizeof(roomType));
tempRoom.Dispose();
srcRoomNumber = GetRoomNumber(thisRoom->floor, thisRoom->suite);
thisRoom->floor = wasFloor;
thisRoom->suite = wasSuite;
for (i = 0; i < kMaxRoomObs; i++) // fix links
{ // first see if a linkable object
if ((ObjectIsLinkTransport(&thisRoom->objects[i])) ||
(ObjectIsLinkSwitch(&thisRoom->objects[i])))
{
linkRoomNumber = GetRoomLinked (&thisRoom->objects[i]);
if (linkRoomNumber == srcRoomNumber)
{ // if linked to an object in same roomÉ
if (ObjectIsLinkSwitch(&thisRoom->objects[i]))
{ // point to new room location
thisRoom->objects[i].data.d.where =
(wasSuite * 100) + wasFloor + kNumUndergroundFloors;
}
else
{ // point to new room location
thisRoom->objects[i].data.e.where =
(wasSuite * 100) + wasFloor + kNumUndergroundFloors;
}
}
}
}
CopyThisRoomToRoom();
ReflectCurrentRoom(false);
fileDirty = true;
UpdateMenus(false);
}
}
#endif
//-------------------------------------------------------------- GetObjectScrap
#ifndef COMPILEDEMO
void GetObjectScrap (void)
{
// this function pastes an object from the clipboard
objectType tempObject;
Handle tempObjectHand;
Point noPoint;
long theErr, scrapOffset;
short direction, dist;
tempObjectHand = NewHandle(0L);
if (tempObjectHand == nil)
{
YellowAlert(kYellowNoMemory, 0);
return;
}
theErr = GetScrap(tempObjectHand, 'Obj.', &scrapOffset);
if (theErr < 0)
YellowAlert(kYellowScrapError, theErr);
else
{
DeselectObject();
noPoint.h = 100;
noPoint.v = 100;
memcpy(&tempObject, *tempObjectHand, sizeof(objectType));
if (AddNewObject(noPoint, tempObject.what, false))
{
thisRoom->objects[objActive] = tempObject;
ReadyBackground(thisRoom->background, thisRoom->tiles);
GetThisRoomsObjRects();
DrawThisRoomsObjects();
UpdateMainWindow();
if (ObjectHasHandle(&direction, &dist))
{
StartMarqueeHandled(&roomObjectRects[objActive], direction, dist);
HandleBlowerGlider();
}
else
StartMarquee(&roomObjectRects[objActive]);
}
tempObjectHand.Dispose();
}
}
#endif
//-------------------------------------------------------------- SeeIfValidScrapAvailable
#ifndef COMPILEDEMO
void SeeIfValidScrapAvailable (Boolean updateMenus)
{
Handle tempRoom, tempObject;
long theErr, scrapOffset;
hasScrap = false;
tempRoom = NewHandle(0L);
if (tempRoom != nil)
{
theErr = GetScrap(tempRoom, 'Room', &scrapOffset);
if (theErr >= 0)
{
hasScrap = true;
scrapIsARoom = true;
}
tempRoom.Dispose();
}
tempObject = NewHandle(0L);
if (tempObject != nil)
{
theErr = GetScrap(tempObject, 'Obj.', &scrapOffset);
if (theErr >= 0)
{
hasScrap = true;
scrapIsARoom = false;
}
tempObject.Dispose();
}
if (updateMenus)
UpdateClipboardMenus();
}
#endif
//-------------------------------------------------------------- DropLocationIsTrash
#if 0
Boolean DropLocationIsTrash (AEDesc *dropLocation)
{
AEDesc dropSpec;
FSSpec *theSpec;
CInfoPBRec thePB;
long trashDirID;
OSErr theErr;
short trashVRefNum;
if ((dropLocation->descriptorType != typeNull) &&
(AECoerceDesc(dropLocation, typeFSS, &dropSpec) == noErr))
{
HLock(dropSpec.dataHandle);
theSpec = (FSSpec *) *dropSpec.dataHandle;
thePB.dirInfo.ioCompletion = 0L;
thePB.dirInfo.ioNamePtr = (StringPtr) &theSpec->name;
thePB.dirInfo.ioVRefNum = theSpec->vRefNum;
thePB.dirInfo.ioFDirIndex = 0;
thePB.dirInfo.ioDrDirID = theSpec->parID;
theErr = PBGetCatInfo(&thePB, false);
HUnlock(dropSpec.dataHandle);
AEDisposeDesc(&dropSpec);
if (theErr != noErr)
return(false);
if (!(thePB.dirInfo.ioFlAttrib & (1 << 4)))
return(false);
FindFolder(theSpec->vRefNum, kTrashFolderType, kCreateFolder,
&trashVRefNum, &trashDirID);
if (thePB.dirInfo.ioDrDirID == trashDirID)
return(true);
}
return(false);
}
#endif
//-------------------------------------------------------------- DragTrackingFunc
#if 0
pascal OSErr DragTrackingFunc (DragTrackingMessage theMessage, WindowPtr theWindow,
void *theRefCon, DragReference theDrag)
{
DragAttributes attributes;
OSErr theErr;
theErr = noErr;
GetDragAttributes(theDrag, &attributes);
switch (theMessage)
{
case dragTrackingEnterWindow:
xxx;
break;
case dragTrackingInWindow:
xxx;
break;
case dragTrackingLeaveWindow:
xxx;
break;
}
return (theErr);
}
#endif
//-------------------------------------------------------------- DragRoom
#if 0
Boolean DragRoom (EventRecord *theEvent, Rect *roomSrc, short roomNumber)
{
DragReference theDrag;
DragAttributes attributes;
AEDesc dropLocation;
Rect largeBounds, smallBounds;
PicHandle smallPict;
roomType *theRoom;
RgnHandle boundsRgn, tempRgn;
// Point dragPoint;
OSErr theErr;
short mouseDnMods, mouseUpMods, copyRoom;
char wasState;
if (thisMac.hasDrag)
{
if (!WaitMouseMoved(theEvent->where))
return(false);
SetPort((GrafPtr)mainWindow);
BeginUpdate((GrafPtr)mainWindow);
UpdateMainWindow();
EndUpdate((GrafPtr)mainWindow);
theErr = NewDrag(&theDrag);
if (theErr != noErr)
return (false);
wasState = HGetState((Handle)thisHouse);
HLock((Handle)thisHouse);
theRoom = &((*thisHouse)->rooms[roomNumber]);
theErr = AddDragItemFlavor(theDrag, (ItemReference)roomNumber,
(FlavorType)'Room', (Ptr)theRoom,
sizeof(roomType), (FlavorFlags)0);
if (theErr != noErr)
{
HSetState((Handle)thisHouse, wasState);
DisposeDrag(theDrag);
return (false);
}
SetRect(&largeBounds, 0, 0, kRoomWide, kTileHigh);
SetRect(&smallBounds, 0, 0, kRoomWide / 4, kTileHigh / 4);
smallPict = OpenPicture(&smallBounds);
CopyBits(&(((GrafPtr)mainWindow)->portBits), &(((GrafPtr)mainWindow)->portBits),
&largeBounds, &smallBounds, srcCopy, nil);
ClosePicture();
HLock((Handle)smallPict);
theErr = AddDragItemFlavor(theDrag, (ItemReference)roomNumber,
(FlavorType)'PICT', (Ptr)(*smallPict),
GetHandleSize((Handle)smallPict), (FlavorFlags)0);
HUnlock((Handle)smallPict);
KillPicture(smallPict);
HSetState((Handle)thisHouse, wasState);
if (theErr != noErr)
{
DisposeDrag(theDrag);
return (false);
}
theErr = SetDragItemBounds(theDrag, (ItemReference)roomNumber, roomSrc);
if (theErr != noErr)
{
DisposeDrag(theDrag);
return (false);
}
boundsRgn = NewRgn();
RectRgn(boundsRgn, roomSrc);
tempRgn = NewRgn();
CopyRgn(boundsRgn, tempRgn);
InsetRgn(tempRgn, 1, 1);
DiffRgn(boundsRgn, tempRgn, boundsRgn);
DisposeRgn(tempRgn);
theErr = TrackDrag(theDrag, theEvent, boundsRgn);
if ((theErr != noErr) && (theErr != userCanceledErr))
{
DisposeRgn(boundsRgn);
DisposeDrag(theDrag);
return(true);
}
theErr = GetDragAttributes(theDrag, &attributes);
if (theErr != noErr)
{
DisposeRgn(boundsRgn);
DisposeDrag(theDrag);
return(true);
}
theErr = GetDropLocation(theDrag, &dropLocation);
if (theErr != noErr)
{
DisposeRgn(boundsRgn);
DisposeDrag(theDrag);
return(true);
}
theErr = GetDragModifiers(theDrag, 0L, &mouseDnMods, &mouseUpMods);
if (theErr != noErr)
{
DisposeRgn(boundsRgn);
DisposeDrag(theDrag);
return(true);
}
copyRoom = (mouseDnMods | mouseUpMods) & optionKey;
if (!(attributes & kDragInsideSenderApplication))
{
if ((!copyRoom) && (DropLocationIsTrash(&dropLocation)))
{
DeselectObject();
DeleteRoom(true);
}
}
else if (attributes & kDragInsideSenderWindow)
{
// SetPort(mapWindow);
// GetDragMouse(theDrag, &dragPoint, 0L);
// GlobalToLocal(&dragPoint);
// MoveRoom(dragPoint);
}
DisposeRgn(boundsRgn);
DisposeDrag(theDrag);
}
return (true);
}
#endif
//-------------------------------------------------------------- InitDragInfo
#if 0
OSErr InitDragInfo (DragInfoHandle dragInfo)
{
OSErr theErr;
DragTrackingHandlerUPP trackingProc;
DragReceiveHandlerUPP receiveProc;
if (!HasDragManager())
return (noErr);
trackingProc = NewDragTrackingHandlerProc(DragTrackingFunc);
(**dragInfo).dragTrackingProc = trackingProc;
theErr = InstallTrackingHandler(trackingProc, mapWindow, dragInfo);
if (theErr != noErr)
return (theErr);
receiveProc = NewDragReceiveHandlerProc(DragReceiveFunc);
(**dragInfo).dragReceiveProc = receiveProc;
theErr = InstallReceiveHandler(receiveProc, (**dragInfo).window, dragInfo);
return err;
}
#endif
//-------------------------------------------------------------- KillDragInfo
#if 0
void KillDragInfo (DragInfoHandle dragInfo)
{
OSErr theErr;
if (!HasDragManager())
return (noErr);
theErr = RemoveTrackingHandler((**dragInfo).dragTrackingProc,
(**dragInfo).window);
theErr = RemoveReceiveHandler((**dragInfo).dragReceiveProc,
(**dragInfo).window);
}
#endif

View File

@@ -9,7 +9,6 @@
#include "PLKeyEncoding.h"
#include "PLSound.h"
#include "PLStandardColors.h"
#include "PLTextUtils.h"
#include "PLTimeTaggedVOSEvent.h"
#include "PLWidgets.h"
#include "ResolveCachingColor.h"
@@ -17,7 +16,9 @@
#include "DialogUtils.h"
#include "Externs.h"
#include "Environ.h"
#include "HostDisplayDriver.h"
#include "House.h"
#include "IGpDisplayDriver.h"
#include "WindowManager.h"
@@ -26,6 +27,8 @@
#define kSoundPrefsDialID 1018
#define kControlPrefsDialID 1023
#define kBrainsPrefsDialID 1024
// Display dialog
#define kDisplayButton 3
#define kSoundButton 4
#define kControlsButton 5
@@ -34,21 +37,23 @@
#define kDisplay3Item 4
#define kDisplay9Item 5
#define kBorder1Item 8
#define kDoColorFadeItem 9
//#define kCurrentDepth 10
//#define k256Depth 11
//#define k16Depth 12
#define kBorder2Item 10
#define kBorder3Item 11
#define kDispDefault 12
//#define kUseQDItem 13
//#define kUseScreen2Item 14
#define k32BitColorItem 9
#define kScaleResolutionItem 10
#define kUseICCProfileItem 11
#define kDoColorFadeItem 12
#define kBorder2Item 13
#define kBorder3Item 14
#define kDispDefault 15
// Sound dialog
#define kSofterItem 4
#define kLouderItem 5
#define kVolNumberItem 7
#define kIdleMusicItem 8
#define kPlayMusicItem 9
#define kSoundDefault 13
// Controls dialog
#define kRightControl 5
#define kLeftControl 6
#define kBattControl 7
@@ -56,6 +61,8 @@
#define kControlDefaults 13
#define kESCPausesRadio 14
#define kTABPausesRadio 15
// Brains dialog
#define kMaxFilesItem 5
#define kQuickTransitCheck 7
#define kDoZoomsCheck 8
@@ -99,11 +106,11 @@ Str15 tempLeftStr, tempRightStr, tempBattStr, tempBandStr;
long tempLeftMap, tempRightMap, tempBattMap, tempBandMap;
short whichCtrl, wasDepthPref;
Boolean wasFade, wasIdle, wasPlay, wasTransit, wasZooms, wasBackground;
Boolean wasEscPauseKey, wasDemos, wasScreen2, nextRestartChange, wasErrorCheck;
Boolean wasEscPauseKey, wasDemos, wasAutoScale, wasUseICCProfile, nextRestartChange, wasErrorCheck, needResolutionReset;
Boolean wasPrettyMap, wasBitchDialogs;
extern short numNeighbors, isDepthPref, maxFiles, willMaxFiles;
extern Boolean isDoColorFade, isPlayMusicIdle, isUseSecondScreen;
extern Boolean isDoColorFade, isPlayMusicIdle, isAutoScale, isUseICCProfile;
extern Boolean isHouseChecks, doBitchDialogs;
extern Boolean isEscPauseKey, failedMusic, isSoundOn, doBackground;
extern Boolean isMusicOn, quickerTransitions, doAutoDemo;
@@ -494,7 +501,6 @@ void DoControlPrefs (void)
prefDlg = PortabilityLayer::DialogManager::GetInstance()->LoadDialog(kControlPrefsDialID, kPutInFront, nullptr);
if (prefDlg == nil)
RedAlert(kErrDialogDidntLoad);
SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface());
for (i = 0; i < 4; i++)
{
GetDialogItemRect(prefDlg, i + kRightControl, &controlRects[i]);
@@ -863,7 +869,8 @@ void DisplayDefaults (void)
numNeighbors = 9;
wasDepthPref = kSwitchIfNeeded;
wasFade = true;
wasScreen2 = false;
wasAutoScale = true;
wasUseICCProfile = true;
}
//-------------------------------------------------------------- FrameDisplayIcon
@@ -907,6 +914,9 @@ void DisplayUpdate (Dialog *theDialog)
DrawDefaultButton(theDialog);
SetDialogItemValue(theDialog, kDoColorFadeItem, (short)wasFade);
SetDialogItemValue(theDialog, k32BitColorItem, wasDepthPref == 32);
SetDialogItemValue(theDialog, kScaleResolutionItem, (short)isAutoScale);
SetDialogItemValue(theDialog, kUseICCProfileItem, (short)isUseICCProfile);
FrameDisplayIcon(theDialog, StdColors::Red());
FrameDialogItemC(theDialog, kBorder1Item, kRedOrangeColor8);
@@ -1002,13 +1012,11 @@ void DoDisplayPrefs (void)
BringUpDialog(&prefDlg, kDisplayPrefsDialID, nullptr);
if (!thisMac.can8Bit)
MyDisableControl(prefDlg, kDoColorFadeItem);
wasNeighbors = numNeighbors;
wasFade = isDoColorFade;
wasDepthPref = isDepthPref;
wasScreen2 = isUseSecondScreen;
wasAutoScale = isAutoScale;
wasUseICCProfile = isUseICCProfile;
leaving = false;
DisplayUpdate(prefDlg);
@@ -1020,10 +1028,13 @@ void DoDisplayPrefs (void)
{
case kOkayButton:
isDoColorFade = wasFade;
isDepthPref = wasDepthPref;
if (isUseSecondScreen != wasScreen2)
if (isDepthPref != wasDepthPref)
nextRestartChange = true;
isUseSecondScreen = wasScreen2;
if (isAutoScale != wasAutoScale)
needResolutionReset = true;
isDepthPref = wasDepthPref;
isAutoScale = wasAutoScale;
isUseICCProfile = wasUseICCProfile;
leaving = true;
break;
@@ -1061,6 +1072,24 @@ void DoDisplayPrefs (void)
SetDialogItemValue(prefDlg, kDoColorFadeItem, (short)wasFade);
break;
case k32BitColorItem:
if (wasDepthPref == 32)
wasDepthPref = 8;
else
wasDepthPref = 32;
SetDialogItemValue(prefDlg, k32BitColorItem, wasDepthPref == 32);
break;
case kScaleResolutionItem:
wasAutoScale = !wasAutoScale;
SetDialogItemValue(prefDlg, kScaleResolutionItem, (short)wasAutoScale);
break;
case kUseICCProfileItem:
wasUseICCProfile = !wasUseICCProfile;
SetDialogItemValue(prefDlg, kUseICCProfileItem, (short)wasUseICCProfile);
break;
case kDispDefault:
FrameDisplayIcon(prefDlg, StdColors::White());
DisplayDefaults();
@@ -1121,6 +1150,8 @@ void SetAllDefaults (void)
quickerTransitions = false;
isDepthPref = kSwitchIfNeeded;
isDoColorFade = true;
needResolutionReset = true;
}
//-------------------------------------------------------------- FlashSettingsButton
@@ -1263,20 +1294,17 @@ void DoSettingsMain (void)
case kDisplayButton:
FlashSettingsButton(surface, 0);
DoDisplayPrefs();
SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface());
break;
case kSoundButton:
FlashSettingsButton(surface, 1);
DoSoundPrefs();
SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface());
FlushEvents(everyEvent, 0);
FlushEvents();
break;
case kControlsButton:
FlashSettingsButton(surface, 2);
DoControlPrefs();
SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface());
break;
case kBrainsButton:
@@ -1288,7 +1316,6 @@ void DoSettingsMain (void)
}
FlashSettingsButton(surface, 3);
DoBrainsPrefs();
SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface());
break;
case kAllDefaultsButton:
@@ -1302,7 +1329,18 @@ void DoSettingsMain (void)
prefDlg->Destroy();
if (nextRestartChange)
{
BitchAboutChanges();
nextRestartChange = false;
}
if (needResolutionReset)
{
PortabilityLayer::HostDisplayDriver::GetInstance()->RequestResetVirtualResolution();
needResolutionReset = false;
}
PortabilityLayer::HostDisplayDriver::GetInstance()->SetUseICCProfile(isUseICCProfile);
}
//-------------------------------------------------------------- BitchAboutChanges

View File

@@ -63,7 +63,6 @@ void InitScoreboardMap(void)
{
Rect bounds;
THandle<BitmapImage> thePicture;
DrawSurface *wasCPort;
PLError_t theErr;
short hOffset;
@@ -73,7 +72,7 @@ void InitScoreboardMap(void)
boardSrcRect = houseRect;
ZeroRectCorner(&boardSrcRect);
boardSrcRect.bottom = kScoreboardTall;
theErr = CreateOffScreenGWorld(&boardSrcMap, &boardSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&boardSrcMap, &boardSrcRect);
if (boardSrcRect.right >= 640)
hOffset = (RectWide(&boardSrcRect) - kMaxViewWidth) / 2;
@@ -91,7 +90,7 @@ void InitScoreboardMap(void)
QSetRect(&badgeSrcRect, 0, 0, 32, 66); // 2144 pixels
if (!badgeSrcMap)
{
theErr = CreateOffScreenGWorld(&badgeSrcMap, &badgeSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&badgeSrcMap, &badgeSrcRect);
LoadGraphic(badgeSrcMap, kBadgePictID);
}
@@ -104,7 +103,7 @@ void InitScoreboardMap(void)
QSetRect(&boardTSrcRect, 0, 0, 256, 12); // room title
if (!boardTSrcMap)
{
theErr = CreateOffScreenGWorld(&boardTSrcMap, &boardTSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&boardTSrcMap, &boardTSrcRect);
}
boardTDestRect = boardTSrcRect;
QOffsetRect(&boardTDestRect, 137 + hOffset, 5);
@@ -112,7 +111,7 @@ void InitScoreboardMap(void)
QSetRect(&boardGSrcRect, 0, 0, 20, 10); // # gliders
if (!boardGSrcMap)
{
theErr = CreateOffScreenGWorld(&boardGSrcMap, &boardGSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&boardGSrcMap, &boardGSrcRect);
}
boardGDestRect = boardGSrcRect;
QOffsetRect(&boardGDestRect, 526 + hOffset, 5);
@@ -121,7 +120,7 @@ void InitScoreboardMap(void)
QSetRect(&boardPSrcRect, 0, 0, 64, 10); // points
if (!boardPSrcMap)
{
theErr = CreateOffScreenGWorld(&boardPSrcMap, &boardPSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&boardPSrcMap, &boardPSrcRect);
}
boardPDestRect = boardPSrcRect;
QOffsetRect(&boardPDestRect, 570 + hOffset, 5); // total = 6396 pixels
@@ -166,13 +165,13 @@ void InitGliderMap (void)
short i;
QSetRect(&glidSrcRect, 0, 0, kGliderWide, 668); // 32112 pixels
theErr = CreateOffScreenGWorld(&glidSrcMap, &glidSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&glidSrcMap, &glidSrcRect);
LoadGraphic(glidSrcMap, kGliderPictID);
theErr = CreateOffScreenGWorld(&glid2SrcMap, &glidSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&glid2SrcMap, &glidSrcRect);
LoadGraphic(glid2SrcMap, kGlider2PictID);
theErr = CreateOffScreenGWorld(&glidMaskMap, &glidSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&glidMaskMap, &glidSrcRect, GpPixelFormats::kBW1);
LoadGraphic(glidMaskMap, kGliderPictID + 1000);
for (i = 0; i <= 20; i++)
@@ -192,10 +191,10 @@ void InitGliderMap (void)
QOffsetRect(&gliderSrc[30], 0, 648);
QSetRect(&shadowSrcRect, 0, 0, kGliderWide, kShadowHigh * kNumShadowSrcRects);
theErr = CreateOffScreenGWorld(&shadowSrcMap, &shadowSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&shadowSrcMap, &shadowSrcRect);
LoadGraphic(shadowSrcMap, kShadowPictID);
theErr = CreateOffScreenGWorld(&shadowMaskMap, &shadowSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&shadowMaskMap, &shadowSrcRect, GpPixelFormats::kBW1);
LoadGraphic(shadowMaskMap, kShadowPictID + 1000);
for (i = 0; i < kNumShadowSrcRects; i++)
@@ -205,10 +204,10 @@ void InitGliderMap (void)
}
QSetRect(&bandsSrcRect, 0, 0, 16, 18); // 304 pixels
theErr = CreateOffScreenGWorld(&bandsSrcMap, &bandsSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&bandsSrcMap, &bandsSrcRect);
LoadGraphic(bandsSrcMap, kRubberBandsPictID);
theErr = CreateOffScreenGWorld(&bandsMaskMap, &bandsSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&bandsMaskMap, &bandsSrcRect, GpPixelFormats::kBW1);
LoadGraphic(bandsMaskMap, kRubberBandsPictID + 1000);
for (i = 0; i < 3; i++)
@@ -228,10 +227,10 @@ void InitBlowers (void)
PLError_t theErr;
QSetRect(&blowerSrcRect, 0, 0, 48, 402); // 19344 pixels
theErr = CreateOffScreenGWorld(&blowerSrcMap, &blowerSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&blowerSrcMap, &blowerSrcRect);
LoadGraphic(blowerSrcMap, kBlowerPictID);
theErr = CreateOffScreenGWorld(&blowerMaskMap, &blowerSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&blowerMaskMap, &blowerSrcRect, GpPixelFormats::kBW1);
LoadGraphic(blowerMaskMap, kBlowerPictID + 1000);
for (i = 0; i < kNumCandleFlames; i++)
@@ -265,16 +264,13 @@ void InitBlowers (void)
void InitFurniture (void)
{
DrawSurface *wasCPort;
PLError_t theErr;
wasCPort = GetGraphicsPort();
QSetRect(&furnitureSrcRect, 0, 0, 64, 278); // 17856 pixels
theErr = CreateOffScreenGWorld(&furnitureSrcMap, &furnitureSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&furnitureSrcMap, &furnitureSrcRect);
LoadGraphic(furnitureSrcMap, kFurniturePictID);
theErr = CreateOffScreenGWorld(&furnitureMaskMap, &furnitureSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&furnitureMaskMap, &furnitureSrcRect, GpPixelFormats::kBW1);
LoadGraphic(furnitureMaskMap, kFurniturePictID + 1000);
QSetRect(&tableSrc, 0, 0, 64, 22);
@@ -300,8 +296,6 @@ void InitFurniture (void)
QSetRect(&deckSrc, 0, 0, 64, 21);
QOffsetRect(&deckSrc, 0, 162);
SetGraphicsPort(wasCPort);
}
//-------------------------------------------------------------- InitPrizes
@@ -314,10 +308,10 @@ void InitPrizes (void)
PLError_t theErr;
QSetRect(&bonusSrcRect, 0, 0, 88, 378); // 33264 pixels
theErr = CreateOffScreenGWorld(&bonusSrcMap, &bonusSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&bonusSrcMap, &bonusSrcRect);
LoadGraphic(bonusSrcMap, kBonusPictID);
theErr = CreateOffScreenGWorld(&bonusMaskMap, &bonusSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&bonusMaskMap, &bonusSrcRect, GpPixelFormats::kBW1);
LoadGraphic(bonusMaskMap, kBonusPictID + 1000);
for (i = 0; i < 11; i++)
@@ -365,10 +359,10 @@ void InitPrizes (void)
sparkleSrc[1] = sparkleSrc[3];
QSetRect(&pointsSrcRect, 0, 0, 24, 120); // 2880 pixels
theErr = CreateOffScreenGWorld(&pointsSrcMap, &pointsSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&pointsSrcMap, &pointsSrcRect);
LoadGraphic(pointsSrcMap, kPointsPictID);
theErr = CreateOffScreenGWorld(&pointsMaskMap, &pointsSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&pointsMaskMap, &pointsSrcRect, GpPixelFormats::kBW1);
LoadGraphic(pointsMaskMap, kPointsPictID + 1000);
for (i = 0; i < 15; i++)
@@ -387,10 +381,10 @@ void InitTransports (void)
PLError_t theErr;
QSetRect(&transSrcRect, 0, 0, 56, 32); // 1848 pixels
theErr = CreateOffScreenGWorld(&transSrcMap, &transSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&transSrcMap, &transSrcRect);
LoadGraphic(transSrcMap, kTransportPictID);
theErr = CreateOffScreenGWorld(&transMaskMap, &transSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&transMaskMap, &transSrcRect, GpPixelFormats::kBW1);
LoadGraphic(transMaskMap, kTransportPictID + 1000);
}
@@ -403,7 +397,7 @@ void InitSwitches (void)
PLError_t theErr;
QSetRect(&switchSrcRect, 0, 0, 32, 104); // 3360 pixels
theErr = CreateOffScreenGWorld(&switchSrcMap, &switchSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&switchSrcMap, &switchSrcRect);
LoadGraphic(switchSrcMap, kSwitchPictID);
QSetRect(&lightSwitchSrc[0], 0, 0, 15, 24);
@@ -442,10 +436,10 @@ void InitLights (void)
PLError_t theErr;
QSetRect(&lightSrcRect, 0, 0, 72, 126); // 9144 pixels
theErr = CreateOffScreenGWorld(&lightSrcMap, &lightSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&lightSrcMap, &lightSrcRect);
LoadGraphic(lightSrcMap, kLightPictID);
theErr = CreateOffScreenGWorld(&lightMaskMap, &lightSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&lightMaskMap, &lightSrcRect, GpPixelFormats::kBW1);
LoadGraphic(lightMaskMap, kLightPictID + 1000);
QSetRect(&flourescentSrc1, 0, 0, 16, 12);
@@ -471,24 +465,24 @@ void InitAppliances (void)
PLError_t theErr;
QSetRect(&applianceSrcRect, 0, 0, 80, 269); // 21600 pixels
theErr = CreateOffScreenGWorld(&applianceSrcMap, &applianceSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&applianceSrcMap, &applianceSrcRect);
LoadGraphic(applianceSrcMap, kAppliancePictID);
theErr = CreateOffScreenGWorld(&applianceMaskMap, &applianceSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&applianceMaskMap, &applianceSrcRect, GpPixelFormats::kBW1);
LoadGraphic(applianceMaskMap, kAppliancePictID + 1000);
QSetRect(&toastSrcRect, 0, 0, 32, 174); // 5600 pixels
theErr = CreateOffScreenGWorld(&toastSrcMap, &toastSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&toastSrcMap, &toastSrcRect);
LoadGraphic(toastSrcMap, kToastPictID);
theErr = CreateOffScreenGWorld(&toastMaskMap, &toastSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&toastMaskMap, &toastSrcRect, GpPixelFormats::kBW1);
LoadGraphic(toastMaskMap, kToastPictID + 1000);
QSetRect(&shredSrcRect, 0, 0, 40, 35); // 1440 pixels
theErr = CreateOffScreenGWorld(&shredSrcMap, &shredSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&shredSrcMap, &shredSrcRect);
LoadGraphic(shredSrcMap, kShreddedPictID);
theErr = CreateOffScreenGWorld(&shredMaskMap, &shredSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&shredMaskMap, &shredSrcRect, GpPixelFormats::kBW1);
LoadGraphic(shredMaskMap, kShreddedPictID + 1000);
QSetRect(&plusScreen1, 0, 0, 32, 22);
@@ -544,52 +538,52 @@ void InitEnemies (void)
PLError_t theErr;
QSetRect(&balloonSrcRect, 0, 0, 24, 30 * kNumBalloonFrames);
theErr = CreateOffScreenGWorld(&balloonSrcMap, &balloonSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&balloonSrcMap, &balloonSrcRect);
LoadGraphic(balloonSrcMap, kBalloonPictID);
theErr = CreateOffScreenGWorld(&balloonMaskMap, &balloonSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&balloonMaskMap, &balloonSrcRect, GpPixelFormats::kBW1);
LoadGraphic(balloonMaskMap, kBalloonPictID + 1000);
QSetRect(&copterSrcRect, 0, 0, 32, 30 * kNumCopterFrames);
theErr = CreateOffScreenGWorld(&copterSrcMap, &copterSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&copterSrcMap, &copterSrcRect);
LoadGraphic(copterSrcMap, kCopterPictID);
theErr = CreateOffScreenGWorld(&copterMaskMap, &copterSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&copterMaskMap, &copterSrcRect, GpPixelFormats::kBW1);
LoadGraphic(copterMaskMap, kCopterPictID + 1000);
QSetRect(&dartSrcRect, 0, 0, 64, 19 * kNumDartFrames);
theErr = CreateOffScreenGWorld(&dartSrcMap, &dartSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&dartSrcMap, &dartSrcRect);
LoadGraphic(dartSrcMap, kDartPictID);
theErr = CreateOffScreenGWorld(&dartMaskMap, &dartSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&dartMaskMap, &dartSrcRect, GpPixelFormats::kBW1);
LoadGraphic(dartMaskMap, kDartPictID + 1000);
QSetRect(&ballSrcRect, 0, 0, 32, 32 * kNumBallFrames);
theErr = CreateOffScreenGWorld(&ballSrcMap, &ballSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&ballSrcMap, &ballSrcRect);
LoadGraphic(ballSrcMap, kBallPictID);
theErr = CreateOffScreenGWorld(&ballMaskMap, &ballSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&ballMaskMap, &ballSrcRect, GpPixelFormats::kBW1);
LoadGraphic(ballMaskMap, kBallPictID + 1000);
QSetRect(&dripSrcRect, 0, 0, 16, 12 * kNumDripFrames);
theErr = CreateOffScreenGWorld(&dripSrcMap, &dripSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&dripSrcMap, &dripSrcRect);
LoadGraphic(dripSrcMap, kDripPictID);
theErr = CreateOffScreenGWorld(&dripMaskMap, &dripSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&dripMaskMap, &dripSrcRect, GpPixelFormats::kBW1);
LoadGraphic(dripMaskMap, kDripPictID + 1000);
QSetRect(&enemySrcRect, 0, 0, 36, 33);
theErr = CreateOffScreenGWorld(&enemySrcMap, &enemySrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&enemySrcMap, &enemySrcRect);
LoadGraphic(enemySrcMap, kEnemyPictID);
theErr = CreateOffScreenGWorld(&enemyMaskMap, &enemySrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&enemyMaskMap, &enemySrcRect, GpPixelFormats::kBW1);
LoadGraphic(enemyMaskMap, kEnemyPictID + 1000);
QSetRect(&fishSrcRect, 0, 0, 16, 16 * kNumFishFrames);
theErr = CreateOffScreenGWorld(&fishSrcMap, &fishSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&fishSrcMap, &fishSrcRect);
LoadGraphic(fishSrcMap, kFishPictID);
theErr = CreateOffScreenGWorld(&fishMaskMap, &fishSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&fishMaskMap, &fishSrcRect, GpPixelFormats::kBW1);
LoadGraphic(fishMaskMap, kFishPictID + 1000);
for (i = 0; i < kNumBalloonFrames; i++)

View File

@@ -57,10 +57,10 @@ void InitClutter (void)
PLError_t theErr;
QSetRect(&clutterSrcRect, 0, 0, 128, 69);
theErr = CreateOffScreenGWorld(&clutterSrcMap, &clutterSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&clutterSrcMap, &clutterSrcRect);
LoadGraphic(clutterSrcMap, kClutterPictID);
theErr = CreateOffScreenGWorld(&clutterMaskMap, &clutterSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&clutterMaskMap, &clutterSrcRect, GpPixelFormats::kBW1);
LoadGraphic(clutterMaskMap, kClutterPictID + 1000);
QSetRect(&flowerSrc[0], 0, 0, 10, 28);
@@ -92,7 +92,7 @@ void InitSupport (void)
PLError_t theErr;
QSetRect(&suppSrcRect, 0, 0, kRoomWide, kFloorSupportTall); // 44
theErr = CreateOffScreenGWorld(&suppSrcMap, &suppSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&suppSrcMap, &suppSrcRect);
LoadGraphic(suppSrcMap, kSupportPictID);
}
@@ -106,10 +106,10 @@ void InitAngel (void)
PLError_t theErr;
QSetRect(&angelSrcRect, 0, 0, 96, 44);
theErr = CreateOffScreenGWorld(&angelSrcMap, &angelSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&angelSrcMap, &angelSrcRect);
LoadGraphic(angelSrcMap, kAngelPictID);
theErr = CreateOffScreenGWorld(&angelMaskMap, &angelSrcRect, GpPixelFormats::kBW1);
theErr = CreateOffScreenGWorldCustomDepth(&angelMaskMap, &angelSrcRect, GpPixelFormats::kBW1);
LoadGraphic(angelMaskMap, kAngelPictID + 1);
}
@@ -119,8 +119,6 @@ PLError_t RecreateOffscreens(void)
{
PLError_t theErr;
PortabilityLayer::QDManager::GetInstance()->SetPort(nullptr);
if (workSrcMap)
DisposeGWorld(workSrcMap);
@@ -132,11 +130,11 @@ PLError_t RecreateOffscreens(void)
workSrcRect = houseRect; // Set up work map
ZeroRectCorner(&workSrcRect);
theErr = CreateOffScreenGWorld(&workSrcMap, &workSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&workSrcMap, &workSrcRect);
backSrcRect = houseRect; // Set up background map
ZeroRectCorner(&backSrcRect);
theErr = CreateOffScreenGWorld(&backSrcMap, &backSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&backSrcMap, &backSrcRect);
return PLErrors::kNone;
}

View File

@@ -5,7 +5,6 @@
//============================================================================
#include "PLTextUtils.h"
#include "PLControlDefinitions.h"
#include "PLPasStr.h"
#include "PLStandardColors.h"
@@ -88,7 +87,7 @@ void CreateToolsOffscreen (void)
if (toolSrcMap == nil)
{
QSetRect(&toolSrcRect, 0, 0, 360, 216);
theErr = CreateOffScreenGWorld(&toolSrcMap, &toolSrcRect, kPreferredPixelFormat);
theErr = CreateOffScreenGWorld(&toolSrcMap, &toolSrcRect);
LoadGraphic(toolSrcMap, kToolsPictID);
}
}
@@ -199,8 +198,6 @@ void EraseSelectedTool (void)
if (toolsWindow == nil)
return;
SetPort(toolsWindow->GetDrawSurface());
toolIcon = toolSelected;
if ((toolMode == kBlowerMode) && (toolIcon >= 7))
{
@@ -471,7 +468,6 @@ void HandleToolsClick (Point wherePt)
if (toolsWindow == nil)
return;
SetPortWindowPort(toolsWindow);
wherePt -= toolsWindow->GetTopLeftCoord();
part = FindControl(wherePt, toolsWindow, &theControl);

View File

@@ -15,6 +15,7 @@
#include "QDPixMap.h"
#include "BitmapImage.h"
#include "DialogManager.h"
#include "DisplayDeviceManager.h"
#include "Externs.h"
#include "HostSystemServices.h"
#include "IconLoader.h"
@@ -211,13 +212,17 @@ void CreateOffScreenPixMap (Rect *theRect, CGrafPtr *offScreen)
//-------------------------------------------------------------------- CreateOffScreenGWorld
// Creates an offscreen GWorldÊusing the depth passed in.
PLError_t CreateOffScreenGWorld (DrawSurface **theGWorld, Rect *bounds, GpPixelFormat_t pixelFormat)
PLError_t CreateOffScreenGWorld (DrawSurface **theGWorld, Rect *bounds)
{
PLError_t theErr;
GpPixelFormat_t pixelFormat = PortabilityLayer::DisplayDeviceManager::GetInstance()->GetPixelFormat();
theErr = NewGWorld(theGWorld, pixelFormat, bounds, nil);
return theErr;
return NewGWorld(theGWorld, pixelFormat, bounds, nil);
}
PLError_t CreateOffScreenGWorldCustomDepth(DrawSurface **theGWorld, Rect *bounds, GpPixelFormat_t pixelFormat)
{
return NewGWorld(theGWorld, pixelFormat, bounds, nil);
}
//-------------------------------------------------------------- KillOffScreenPixMap
@@ -424,7 +429,7 @@ Boolean WaitForInputEvent (short seconds)
Boolean waiting, didResume;
timeToBail = TickCount() + 60L * (long)seconds;
FlushEvents(everyEvent, 0);
FlushEvents();
waiting = true;
didResume = false;
@@ -446,7 +451,7 @@ Boolean WaitForInputEvent (short seconds)
Delay(1, nullptr);
}
FlushEvents(everyEvent, 0);
FlushEvents();
return (didResume);
}
@@ -469,7 +474,7 @@ void WaitCommandQReleased (void)
Delay(1, nullptr);
}
FlushEvents(everyEvent, 0);
FlushEvents();
}
//-------------------------------------------------------------- KeyMapOffsetFromRawKey

View File

@@ -9,4 +9,5 @@
#include "GpPixelFormat.h"
PLError_t CreateOffScreenGWorld (DrawSurface **surface, Rect *bounds, GpPixelFormat_t pixelFormat);
PLError_t CreateOffScreenGWorld (DrawSurface **surface, Rect *bounds);
PLError_t CreateOffScreenGWorldCustomDepth (DrawSurface **surface, Rect *bounds, GpPixelFormat_t pixelFormat);

View File

@@ -65,10 +65,7 @@ void GetWindowRect (WindowPtr theWindow, Rect *bounds)
void GetLocalWindowRect (WindowPtr theWindow, Rect *bounds)
{
if (theWindow != nil)
{
SetPortWindowPort(theWindow);
*bounds = theWindow->GetDrawSurface()->m_port.GetRect();
}
}
//-------------------------------------------------------------- FlagWindowFloating

View File

@@ -10,6 +10,11 @@ void GpAudioDriverXAudio2::Shutdown()
delete this;
}
IGpPrefsHandler *GpAudioDriverXAudio2::GetPrefsHandler() const
{
return nullptr;
}
const GpAudioDriverProperties &GpAudioDriverXAudio2::GetProperties() const
{
return m_properties;

View File

@@ -14,6 +14,8 @@ public:
void SetMasterVolume(uint32_t vol, uint32_t maxVolume) override;
void Shutdown() override;
IGpPrefsHandler *GetPrefsHandler() const override;
const GpAudioDriverProperties &GetProperties() const;
IXAudio2 *GetXA2() const;
IXAudio2MasteringVoice *GetMasteringVoice() const;

View File

@@ -132,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>

View File

@@ -42,4 +42,7 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>

View 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>

View File

@@ -0,0 +1,9 @@
#pragma once
#define GP_BUILD_VERSION_MAJOR 1
#define GP_BUILD_VERSION_MINOR 0
#define GP_BUILD_VERSION_UPDATE 4
#define GP_APPLICATION_VERSION_STRING "1.0.4"
#define GP_APPLICATION_COPYRIGHT_STRING "2019-2020 Eric Lasota"
#define GP_APPLICATION_WEBSITE_STRING "https://github.com/elasota/Aerofoil"

View File

@@ -3,6 +3,7 @@
#include <stdint.h>
struct IGpAudioChannel;
struct IGpPrefsHandler;
struct IGpAudioDriver
{
@@ -12,4 +13,6 @@ public:
virtual void SetMasterVolume(uint32_t vol, uint32_t maxVolume) = 0;
virtual void Shutdown() = 0;
virtual IGpPrefsHandler *GetPrefsHandler() const = 0;
};

View File

@@ -5,6 +5,8 @@
struct IGpDisplayDriverSurface;
struct IGpCursor;
struct IGpPrefsHandler;
struct GpDisplayDriverProperties;
struct GpDisplayDriverSurfaceEffects
{
@@ -26,7 +28,7 @@ public:
virtual void Run() = 0;
virtual void Shutdown() = 0;
virtual void GetDisplayResolution(unsigned int *width, unsigned int *height, GpPixelFormat_t *bpp) = 0;
virtual void GetDisplayResolution(unsigned int *width, unsigned int *height) = 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, const GpDisplayDriverSurfaceEffects *effects) = 0;
@@ -38,8 +40,15 @@ public:
virtual void UpdatePalette(const void *paletteData) = 0;
virtual void SetBackgroundColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a) = 0;
virtual void SetBackgroundDarkenEffect(bool isDark) = 0;
virtual void SetUseICCProfile(bool useICCProfile) = 0;
virtual void RequestToggleFullScreen(uint32_t timestamp) = 0;
virtual void RequestResetVirtualResolution() = 0;
virtual const GpDisplayDriverProperties &GetProperties() const = 0;
virtual IGpPrefsHandler *GetPrefsHandler() const = 0;
};
inline GpDisplayDriverSurfaceEffects::GpDisplayDriverSurfaceEffects()

View File

@@ -1,7 +1,11 @@
#pragma once
struct IGpPrefsHandler;
struct IGpInputDriver
{
virtual void ProcessInput() = 0;
virtual void Shutdown() = 0;
virtual IGpPrefsHandler *GetPrefsHandler() const = 0;
};

View File

@@ -0,0 +1,11 @@
#pragma once
#include <stdint.h>
struct IGpPrefsHandler
{
typedef bool (*WritePrefsFunc_t) (void *context, const void *identifier, size_t identifierSize, const void *contents, size_t contentsSize, uint32_t version);
virtual void ApplyPrefs(const void *identifier, size_t identifierSize, const void *contents, size_t contentsSize, uint32_t version) = 0;
virtual bool SavePrefs(void *context, WritePrefsFunc_t writeFunc) = 0;
};

View File

@@ -0,0 +1,52 @@
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,
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,
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,
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
{
const unsigned char *g_drawQuad15BitICCP_D3D11[2] = { gs_shaderData, gs_shaderData + sizeof(gs_shaderData) };
};

View File

@@ -1,8 +1,8 @@
static unsigned char gs_shaderData[] = {
68, 88, 66, 67, 123, 171, 231, 206, 83, 178, 250, 149, 189, 168, 129,
29, 12, 186, 195, 194, 1, 0, 0, 0, 24, 9, 0, 0, 5, 0,
68, 88, 66, 67, 167, 218, 15, 90, 211, 69, 240, 219, 76, 79, 17,
242, 61, 175, 125, 206, 1, 0, 0, 0, 44, 8, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0, 172, 2, 0, 0, 4, 3, 0, 0, 56,
3, 0, 0, 156, 8, 0, 0, 82, 68, 69, 70, 112, 2, 0, 0,
3, 0, 0, 176, 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,
@@ -54,13 +54,13 @@ static unsigned char gs_shaderData[] = {
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, 92, 5, 0, 0, 64, 0, 0, 0, 87, 1, 0, 0,
72, 68, 82, 112, 4, 0, 0, 64, 0, 0, 0, 28, 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, 4, 0, 0, 0, 65, 0, 0, 5, 50, 0, 16, 0, 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,
@@ -93,68 +93,52 @@ static unsigned char gs_shaderData[] = {
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, 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, 31, 0, 4, 3, 10, 0, 16,
0, 1, 0, 0, 0, 29, 0, 0, 10, 114, 0, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0, 28, 46, 77, 59, 28, 46, 77, 59, 28,
46, 77, 59, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0,
56, 0, 0, 10, 114, 0, 16, 0, 2, 0, 0, 0, 70, 2, 16,
0, 0, 0, 0, 0, 2, 64, 0, 0, 82, 184, 78, 65, 82, 184,
78, 65, 82, 184, 78, 65, 0, 0, 0, 0, 47, 0, 0, 5, 114,
0, 16, 0, 3, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0,
56, 0, 0, 10, 114, 0, 16, 0, 3, 0, 0, 0, 70, 2, 16,
0, 3, 0, 0, 0, 2, 64, 0, 0, 85, 85, 213, 62, 85, 85,
213, 62, 85, 85, 213, 62, 0, 0, 0, 0, 25, 0, 0, 5, 114,
0, 16, 0, 3, 0, 0, 0, 70, 2, 16, 0, 3, 0, 0, 0,
50, 0, 0, 15, 114, 0, 16, 0, 3, 0, 0, 0, 70, 2, 16,
0, 3, 0, 0, 0, 2, 64, 0, 0, 61, 10, 135, 63, 61, 10,
135, 63, 61, 10, 135, 63, 0, 0, 0, 0, 2, 64, 0, 0, 174,
71, 97, 189, 174, 71, 97, 189, 174, 71, 97, 189, 0, 0, 0, 0,
55, 0, 0, 9, 114, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16,
0, 1, 0, 0, 0, 70, 2, 16, 0, 2, 0, 0, 0, 70, 2,
16, 0, 3, 0, 0, 0, 16, 0, 0, 10, 130, 0, 16, 0, 1,
0, 0, 0, 70, 2, 16, 0, 1, 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, 18, 0, 16, 0, 2, 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, 130, 0, 16, 0,
1, 0, 0, 0, 58, 0, 16, 0, 1, 0, 0, 0, 10, 128, 32,
0, 0, 0, 0, 0, 2, 0, 0, 0, 50, 0, 0, 9, 114, 0,
16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 1, 0, 0, 0, 6,
0, 16, 0, 2, 0, 0, 0, 246, 15, 16, 0, 1, 0, 0, 0,
29, 0, 0, 10, 114, 0, 16, 0, 2, 0, 0, 0, 2, 64, 0,
0, 230, 174, 37, 61, 230, 174, 37, 61, 230, 174, 37, 61, 0, 0,
0, 0, 70, 2, 16, 0, 1, 0, 0, 0, 56, 0, 0, 10, 114,
0, 16, 0, 3, 0, 0, 0, 70, 2, 16, 0, 1, 0, 0, 0,
2, 64, 0, 0, 145, 131, 158, 61, 145, 131, 158, 61, 145, 131, 158,
61, 0, 0, 0, 0, 0, 0, 0, 10, 114, 0, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0, 1, 0, 0, 0, 2, 64, 0, 0, 174,
71, 97, 61, 174, 71, 97, 61, 174, 71, 97, 61, 0, 0, 0, 0,
56, 0, 0, 10, 114, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16,
0, 1, 0, 0, 0, 2, 64, 0, 0, 110, 167, 114, 63, 110, 167,
114, 63, 110, 167, 114, 63, 0, 0, 0, 0, 47, 0, 0, 5, 114,
0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 1, 0, 0, 0,
56, 0, 0, 10, 114, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16,
0, 1, 0, 0, 0, 2, 64, 0, 0, 154, 153, 25, 64, 154, 153,
25, 64, 154, 153, 25, 64, 0, 0, 0, 0, 25, 0, 0, 5, 114,
0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 1, 0, 0, 0,
55, 0, 0, 9, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16,
0, 2, 0, 0, 0, 70, 2, 16, 0, 3, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0, 21, 0, 0, 1, 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, 54, 0, 0, 5, 242, 32, 16, 0, 0, 0,
0, 0, 70, 14, 16, 0, 0, 0, 0, 0, 62, 0, 0, 1, 83,
84, 65, 84, 116, 0, 0, 0, 42, 0, 0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 2, 0, 0, 0, 22, 0, 0, 0, 4, 0, 0,
0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 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, 0, 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, 29, 0, 0, 10, 114, 0, 16, 0, 1, 0, 0, 0,
2, 64, 0, 0, 230, 174, 37, 61, 230, 174, 37, 61, 230, 174, 37,
61, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 56, 0,
0, 10, 114, 0, 16, 0, 2, 0, 0, 0, 70, 2, 16, 0, 0,
0, 0, 0, 2, 64, 0, 0, 145, 131, 158, 61, 145, 131, 158, 61,
145, 131, 158, 61, 0, 0, 0, 0, 0, 0, 0, 10, 114, 0, 16,
0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 2, 64,
0, 0, 174, 71, 97, 61, 174, 71, 97, 61, 174, 71, 97, 61, 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, 110, 167, 114,
63, 110, 167, 114, 63, 110, 167, 114, 63, 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, 154, 153, 25,
64, 154, 153, 25, 64, 154, 153, 25, 64, 0, 0, 0, 0, 25, 0,
0, 5, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0,
0, 0, 0, 55, 0, 0, 9, 114, 32, 16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 2, 0, 0,
0, 70, 2, 16, 0, 0, 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, 34, 0, 0, 0,
3, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 16, 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, 0, 2, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 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, 2, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,
0, 4, 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, 0,
};
namespace GpBinarizedShaders

View File

@@ -0,0 +1,143 @@
static unsigned char gs_shaderData[] = {
68, 88, 66, 67, 63, 150, 199, 197, 210, 83, 220, 166, 163, 78, 42,
252, 31, 18, 160, 91, 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,
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, 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, 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, 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, 32, 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, 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,
};
namespace GpBinarizedShaders
{
const unsigned char *g_drawQuadPaletteICCP_D3D11[2] = { gs_shaderData, gs_shaderData + sizeof(gs_shaderData) };
};

View File

@@ -1,46 +1,136 @@
static unsigned char gs_shaderData[] = {
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,
68, 88, 66, 67, 55, 11, 130, 121, 223, 86, 90, 24, 177, 20, 124,
204, 5, 205, 68, 19, 1, 0, 0, 0, 176, 7, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0, 124, 2, 0, 0, 212, 2, 0, 0, 8,
3, 0, 0, 52, 7, 0, 0, 82, 68, 69, 70, 64, 2, 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, 24, 2, 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,
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, 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,
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, 68, 114, 97, 119, 81, 117, 97, 100, 80, 105, 120, 101,
108, 67, 111, 110, 115, 116, 97, 110, 116, 115, 0, 171, 107, 0, 0,
0, 6, 0, 0, 0, 156, 0, 0, 0, 48, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 0, 0, 16,
0, 0, 0, 2, 0, 0, 0, 68, 1, 0, 0, 0, 0, 0, 0,
84, 1, 0, 0, 16, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0,
0, 108, 1, 0, 0, 0, 0, 0, 0, 124, 1, 0, 0, 24, 0,
0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 156, 1, 0, 0, 0,
0, 0, 0, 172, 1, 0, 0, 28, 0, 0, 0, 4, 0, 0, 0,
2, 0, 0, 0, 156, 1, 0, 0, 0, 0, 0, 0, 202, 1, 0,
0, 32, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 228, 1,
0, 0, 0, 0, 0, 0, 244, 1, 0, 0, 36, 0, 0, 0, 12,
0, 0, 0, 0, 0, 0, 0, 8, 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,
36, 4, 0, 0, 64, 0, 0, 0, 9, 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, 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, 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, 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, 0, 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, 29,
0, 0, 10, 114, 0, 16, 0, 1, 0, 0, 0, 2, 64, 0, 0,
230, 174, 37, 61, 230, 174, 37, 61, 230, 174, 37, 61, 0, 0, 0,
0, 70, 2, 16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 114, 0,
16, 0, 2, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 2,
64, 0, 0, 145, 131, 158, 61, 145, 131, 158, 61, 145, 131, 158, 61,
0, 0, 0, 0, 0, 0, 0, 10, 114, 0, 16, 0, 0, 0, 0,
0, 70, 2, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 174, 71,
97, 61, 174, 71, 97, 61, 174, 71, 97, 61, 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, 110, 167, 114, 63, 110, 167, 114,
63, 110, 167, 114, 63, 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, 154, 153, 25, 64, 154, 153, 25,
64, 154, 153, 25, 64, 0, 0, 0, 0, 25, 0, 0, 5, 114, 0,
16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 55,
0, 0, 9, 114, 32, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 70, 2, 16, 0, 2, 0, 0, 0, 70, 2, 16,
0, 0, 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, 16, 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,
1, 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, 4, 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, 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,
};
namespace GpBinarizedShaders

View File

@@ -0,0 +1,135 @@
static unsigned char gs_shaderData[] = {
68, 88, 66, 67, 59, 168, 168, 88, 76, 243, 83, 77, 18, 124, 254,
1, 241, 101, 79, 130, 1, 0, 0, 0, 116, 7, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0, 124, 2, 0, 0, 212, 2, 0, 0, 8,
3, 0, 0, 248, 6, 0, 0, 82, 68, 69, 70, 64, 2, 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, 24, 2, 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, 68, 114, 97, 119, 81, 117, 97, 100, 80, 105, 120, 101,
108, 67, 111, 110, 115, 116, 97, 110, 116, 115, 0, 171, 107, 0, 0,
0, 6, 0, 0, 0, 156, 0, 0, 0, 48, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 0, 0, 16,
0, 0, 0, 2, 0, 0, 0, 68, 1, 0, 0, 0, 0, 0, 0,
84, 1, 0, 0, 16, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0,
0, 108, 1, 0, 0, 0, 0, 0, 0, 124, 1, 0, 0, 24, 0,
0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 156, 1, 0, 0, 0,
0, 0, 0, 172, 1, 0, 0, 28, 0, 0, 0, 4, 0, 0, 0,
2, 0, 0, 0, 156, 1, 0, 0, 0, 0, 0, 0, 202, 1, 0,
0, 32, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 228, 1,
0, 0, 0, 0, 0, 0, 244, 1, 0, 0, 36, 0, 0, 0, 12,
0, 0, 0, 0, 0, 0, 0, 8, 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,
232, 3, 0, 0, 64, 0, 0, 0, 250, 0, 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, 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, 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, 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, 32, 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, 30, 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, 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, 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,
};
namespace GpBinarizedShaders
{
const unsigned char *g_drawQuadRGBICCP_D3D11[2] = { gs_shaderData, gs_shaderData + sizeof(gs_shaderData) };
};

View File

@@ -21,13 +21,27 @@
static GpDisplayDriverSurfaceEffects gs_defaultEffects;
static const char *kPrefsIdentifier = "GpDisplayDriverD3D11";
static uint32_t kPrefsVersion = 1;
struct GpDisplayDriverD3D11_Prefs
{
bool m_isFullScreen;
};
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];
extern const unsigned char *g_drawQuadPaletteICCP_D3D11[2];
extern const unsigned char *g_drawQuadRGBICCP_D3D11[2];
extern const unsigned char *g_drawQuad15BitICCP_D3D11[2];
extern const unsigned char *g_scaleQuadP_D3D11[2];
}
struct GpShaderCodeBlob
@@ -461,12 +475,18 @@ bool GpDisplayDriverD3D11::InitResources(uint32_t virtualWidth, uint32_t virtual
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 drawQuadPaletteICCPBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuadPaletteICCP_D3D11);
const GpShaderCodeBlob drawQuadRGBICCPBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuadRGBICCP_D3D11);
const GpShaderCodeBlob drawQuad15BitICCPBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuad15BitICCP_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(drawQuadPaletteICCPBlob.m_data, drawQuadPaletteICCPBlob.m_size, nullptr, m_drawQuadPaletteICCPixelShader.GetMutablePtr());
m_device->CreatePixelShader(drawQuadRGBICCPBlob.m_data, drawQuadRGBICCPBlob.m_size, nullptr, m_drawQuadRGBICCPixelShader.GetMutablePtr());
m_device->CreatePixelShader(drawQuad15BitICCPBlob.m_data, drawQuad15BitICCPBlob.m_size, nullptr, m_drawQuad15BitICCPixelShader.GetMutablePtr());
m_device->CreatePixelShader(scaleQuadPBlob.m_data, scaleQuadPBlob.m_size, nullptr, m_scaleQuadPixelShader.GetMutablePtr());
// Quad input layout
@@ -544,7 +564,7 @@ bool GpDisplayDriverD3D11::InitResources(uint32_t virtualWidth, uint32_t virtual
}
}
DXGI_FORMAT paletteTextureFormat = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
DXGI_FORMAT paletteTextureFormat = DXGI_FORMAT_R8G8B8A8_UNORM;
// Palette texture
{
@@ -606,7 +626,18 @@ GpDisplayDriverTickStatus_t GpDisplayDriverD3D11::PresentFrameAndSync()
{
SynchronizeCursors();
m_deviceContext->ClearRenderTargetView(m_virtualScreenTextureRTV, m_bgColor);
FLOAT bgColor[4];
for (int i = 0; i < 4; i++)
bgColor[i] = m_bgColor[i];
if (m_bgIsDark)
{
for (int i = 0; i < 3; i++)
bgColor[i] *= 0.25f;
}
m_deviceContext->ClearRenderTargetView(m_virtualScreenTextureRTV, bgColor);
//ID3D11RenderTargetView *const rtv = m_backBufferRTV;
ID3D11RenderTargetView *const vsRTV = m_virtualScreenTextureRTV;
@@ -1152,7 +1183,7 @@ void GpDisplayDriverD3D11::Run()
unsigned int desiredWidth = clientRect.right - clientRect.left;
unsigned int desiredHeight = clientRect.bottom - clientRect.top;
if (clientRect.right - clientRect.left != m_windowWidthPhysical || clientRect.bottom - clientRect.top != m_windowHeightPhysical)
if (clientRect.right - clientRect.left != m_windowWidthPhysical || clientRect.bottom - clientRect.top != m_windowHeightPhysical || m_isResolutionResetDesired)
{
uint32_t prevWidthPhysical = m_windowWidthPhysical;
uint32_t prevHeightPhysical = m_windowHeightPhysical;
@@ -1177,6 +1208,7 @@ void GpDisplayDriverD3D11::Run()
m_windowHeightVirtual = virtualHeight;
m_pixelScaleX = pixelScaleX;
m_pixelScaleY = pixelScaleY;
m_isResolutionResetDesired = false;
if (GpVOSEvent *resizeEvent = m_properties.m_eventQueue->QueueEvent())
{
@@ -1205,14 +1237,12 @@ void GpDisplayDriverD3D11::Shutdown()
free(this);
}
void GpDisplayDriverD3D11::GetDisplayResolution(unsigned int *width, unsigned int *height, GpPixelFormat_t *pixelFormat)
void GpDisplayDriverD3D11::GetDisplayResolution(unsigned int *width, unsigned int *height)
{
if (width)
*width = m_windowWidthVirtual;
if (height)
*height = m_windowHeightVirtual;
if (pixelFormat)
*pixelFormat = GpPixelFormats::k8BitStandard;
}
IGpDisplayDriverSurface *GpDisplayDriverD3D11::CreateSurface(size_t width, size_t height, GpPixelFormat_t pixelFormat)
@@ -1312,7 +1342,7 @@ void GpDisplayDriverD3D11::DrawSurface(IGpDisplayDriverSurface *surface, int32_t
m_paletteTextureSRV
};
m_deviceContext->PSSetShader(m_drawQuadPalettePixelShader, nullptr, 0);
m_deviceContext->PSSetShader(m_useICCProfile ? m_drawQuadPaletteICCPixelShader : m_drawQuadPalettePixelShader, nullptr, 0);
m_deviceContext->PSSetShaderResources(0, sizeof(psResourceViews) / sizeof(psResourceViews[0]), psResourceViews);
}
else if (pixelFormat == GpPixelFormats::kRGB555)
@@ -1322,7 +1352,7 @@ void GpDisplayDriverD3D11::DrawSurface(IGpDisplayDriverSurface *surface, int32_t
d3d11Surface->GetSRV(),
};
m_deviceContext->PSSetShader(m_drawQuad15BitPixelShader, nullptr, 0);
m_deviceContext->PSSetShader(m_useICCProfile ? m_drawQuad15BitICCPixelShader : m_drawQuad15BitPixelShader, nullptr, 0);
m_deviceContext->PSSetShaderResources(0, sizeof(psResourceViews) / sizeof(psResourceViews[0]), psResourceViews);
}
else if (pixelFormat == GpPixelFormats::kRGB32)
@@ -1332,7 +1362,7 @@ void GpDisplayDriverD3D11::DrawSurface(IGpDisplayDriverSurface *surface, int32_t
d3d11Surface->GetSRV(),
};
m_deviceContext->PSSetShader(m_drawQuadRGBPixelShader, nullptr, 0);
m_deviceContext->PSSetShader(m_useICCProfile ? m_drawQuadRGBICCPixelShader : m_drawQuadRGBPixelShader, nullptr, 0);
m_deviceContext->PSSetShaderResources(0, sizeof(psResourceViews) / sizeof(psResourceViews[0]), psResourceViews);
}
else
@@ -1414,6 +1444,17 @@ void GpDisplayDriverD3D11::SetBackgroundColor(uint8_t r, uint8_t g, uint8_t b, u
m_bgColor[3] = static_cast<float>(a) / 255.0f;
}
void GpDisplayDriverD3D11::SetBackgroundDarkenEffect(bool isDark)
{
m_bgIsDark = isDark;
}
void GpDisplayDriverD3D11::SetUseICCProfile(bool useICCProfile)
{
m_useICCProfile = useICCProfile;
}
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 elapsed
@@ -1424,6 +1465,39 @@ void GpDisplayDriverD3D11::RequestToggleFullScreen(uint32_t timestamp)
}
}
void GpDisplayDriverD3D11::RequestResetVirtualResolution()
{
m_isResolutionResetDesired = true;
}
const GpDisplayDriverProperties &GpDisplayDriverD3D11::GetProperties() const
{
return m_properties;
}
IGpPrefsHandler *GpDisplayDriverD3D11::GetPrefsHandler() const
{
const IGpPrefsHandler *cPrefsHandler = this;
return const_cast<IGpPrefsHandler*>(cPrefsHandler);
}
void GpDisplayDriverD3D11::ApplyPrefs(const void *identifier, size_t identifierSize, const void *contents, size_t contentsSize, uint32_t version)
{
if (version == kPrefsVersion && identifierSize == strlen(kPrefsIdentifier) && !memcmp(identifier, kPrefsIdentifier, identifierSize))
{
const GpDisplayDriverD3D11_Prefs *prefs = static_cast<const GpDisplayDriverD3D11_Prefs *>(contents);
m_isFullScreenDesired = prefs->m_isFullScreen;
}
}
bool GpDisplayDriverD3D11::SavePrefs(void *context, IGpPrefsHandler::WritePrefsFunc_t writeFunc)
{
GpDisplayDriverD3D11_Prefs prefs;
prefs.m_isFullScreen = m_isFullScreenDesired;
return writeFunc(context, kPrefsIdentifier, strlen(kPrefsIdentifier), &prefs, sizeof(prefs), kPrefsVersion);
}
GpDisplayDriverD3D11 *GpDisplayDriverD3D11::Create(const GpDisplayDriverProperties &properties)
{
void *storage = malloc(sizeof(GpDisplayDriverD3D11));
@@ -1451,7 +1525,10 @@ GpDisplayDriverD3D11::GpDisplayDriverD3D11(const GpDisplayDriverProperties &prop
, m_mouseIsInClientArea(false)
, m_isFullScreen(false)
, m_isFullScreenDesired(false)
, m_isResolutionResetDesired(false)
, m_lastFullScreenToggleTimeStamp(0)
, m_bgIsDark(false)
, m_useICCProfile(false)
{
memset(&m_syncTimeBase, 0, sizeof(m_syncTimeBase));
memset(&m_windowModeRevertRect, 0, sizeof(m_windowModeRevertRect));
@@ -1464,10 +1541,10 @@ GpDisplayDriverD3D11::GpDisplayDriverD3D11(const GpDisplayDriverProperties &prop
m_ibeamCursor = reinterpret_cast<HCURSOR>(LoadImageW(nullptr, MAKEINTRESOURCEW(OCR_IBEAM), IMAGE_CURSOR, 0, 0, LR_SHARED));
m_waitCursor = reinterpret_cast<HCURSOR>(LoadImageW(nullptr, MAKEINTRESOURCEW(OCR_WAIT), IMAGE_CURSOR, 0, 0, LR_SHARED));
m_bgColor[0] = 0;
m_bgColor[1] = 0;
m_bgColor[2] = 0;
m_bgColor[3] = 255;
m_bgColor[0] = 0.0f;
m_bgColor[1] = 0.0f;
m_bgColor[2] = 0.0f;
m_bgColor[3] = 1.0f;
}
GpDisplayDriverD3D11::~GpDisplayDriverD3D11()

View File

@@ -4,12 +4,15 @@
#include "GpRingBuffer.h"
#include "IGpDisplayDriver.h"
#include "IGpPrefsHandler.h"
#include "GpCoreDefs.h"
#include "GpDisplayDriverProperties.h"
#include "GpComPtr.h"
#include "GpPixelFormat.h"
#include "IGpPrefsHandler.h"
struct GpWindowsGlobals;
struct IGpCursor_Win32;
struct IGpCursor;
@@ -30,13 +33,13 @@ struct ID3D11Texture2D;
struct ID3D11VertexShader;
class GpDisplayDriverD3D11 : public IGpDisplayDriver
class GpDisplayDriverD3D11 : public IGpDisplayDriver, public IGpPrefsHandler
{
public:
void Run() override;
void Shutdown() override;
void GetDisplayResolution(unsigned int *width, unsigned int *height, GpPixelFormat_t *bpp) override;
void GetDisplayResolution(unsigned int *width, unsigned int *height) override;
IGpDisplayDriverSurface *CreateSurface(size_t width, size_t height, GpPixelFormat_t pixelFormat) override;
void DrawSurface(IGpDisplayDriverSurface *surface, int32_t x, int32_t y, size_t width, size_t height, const GpDisplayDriverSurfaceEffects *effects) override;
@@ -48,8 +51,18 @@ public:
void UpdatePalette(const void *paletteData) override;
void SetBackgroundColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a) override;
void SetBackgroundDarkenEffect(bool isDark) override;
void SetUseICCProfile(bool useICCProfile) override;
void RequestToggleFullScreen(uint32_t timestamp) override;
void RequestResetVirtualResolution() override;
const GpDisplayDriverProperties &GetProperties() const override;
IGpPrefsHandler *GetPrefsHandler() const override;
void ApplyPrefs(const void *identifier, size_t identifierSize, const void *contents, size_t contentsSize, uint32_t version) override;
bool SavePrefs(void *context, IGpPrefsHandler::WritePrefsFunc_t writeFunc) override;
static GpDisplayDriverD3D11 *Create(const GpDisplayDriverProperties &properties);
@@ -118,6 +131,9 @@ private:
GpComPtr<ID3D11PixelShader> m_drawQuadPalettePixelShader;
GpComPtr<ID3D11PixelShader> m_drawQuad15BitPixelShader;
GpComPtr<ID3D11PixelShader> m_drawQuadRGBPixelShader;
GpComPtr<ID3D11PixelShader> m_drawQuadPaletteICCPixelShader;
GpComPtr<ID3D11PixelShader> m_drawQuad15BitICCPixelShader;
GpComPtr<ID3D11PixelShader> m_drawQuadRGBICCPixelShader;
GpComPtr<ID3D11PixelShader> m_scaleQuadPixelShader;
GpComPtr<ID3D11Buffer> m_drawQuadVertexConstantBuffer;
GpComPtr<ID3D11Buffer> m_drawQuadPixelConstantBuffer;
@@ -144,6 +160,7 @@ private:
bool m_isFullScreen;
bool m_isFullScreenDesired;
bool m_isResolutionResetDesired;
RECT m_windowModeRevertRect;
uint32_t m_lastFullScreenToggleTimeStamp;
@@ -152,7 +169,7 @@ private:
DWORD m_windowWidthPhysical; // Physical resolution is the resolution of the actual window
DWORD m_windowHeightPhysical;
DWORD m_windowWidthVirtual; // Virtual resolution is the resolution reported to teh game
DWORD m_windowWidthVirtual; // Virtual resolution is the resolution reported to the game
DWORD m_windowHeightVirtual;
float m_pixelScaleX;
float m_pixelScaleY;
@@ -171,4 +188,7 @@ private:
HCURSOR m_ibeamCursor;
float m_bgColor[4];
bool m_bgIsDark;
bool m_useICCProfile;
};

View File

@@ -93,7 +93,7 @@ GpDisplayDriverSurfaceD3D11 *GpDisplayDriverSurfaceD3D11::Create(ID3D11Device *d
dxgiFormat = DXGI_FORMAT_R16_UINT;
break;
case GpPixelFormats::kRGB32:
dxgiFormat = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
dxgiFormat = DXGI_FORMAT_R8G8B8A8_UNORM;
break;
case GpPixelFormats::kRGB24: // RGB24 is not supported as a surface format (PL must convert it)
default:

View File

@@ -126,8 +126,11 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="CompiledShaders\DrawQuad15BitP_D3D11.cpp" />
<ClCompile Include="CompiledShaders\DrawQuad15BitP_ICC_D3D11.cpp" />
<ClCompile Include="CompiledShaders\DrawQuadPaletteP_D3D11.cpp" />
<ClCompile Include="CompiledShaders\DrawQuadPaletteP_ICC_D3D11.cpp" />
<ClCompile Include="CompiledShaders\DrawQuadRGBP_D3D11.cpp" />
<ClCompile Include="CompiledShaders\DrawQuadRGBP_ICC_D3D11.cpp" />
<ClCompile Include="CompiledShaders\DrawQuadV_D3D11.cpp" />
<ClCompile Include="CompiledShaders\ScaleQuadP_D3D11.cpp" />
<ClCompile Include="GpDisplayDriverD3D11.cpp" />

View File

@@ -42,6 +42,15 @@
<ClCompile Include="CompiledShaders\ScaleQuadP_D3D11.cpp">
<Filter>Source Files\CompiledShaders</Filter>
</ClCompile>
<ClCompile Include="CompiledShaders\DrawQuad15BitP_ICC_D3D11.cpp">
<Filter>Source Files\CompiledShaders</Filter>
</ClCompile>
<ClCompile Include="CompiledShaders\DrawQuadPaletteP_ICC_D3D11.cpp">
<Filter>Source Files\CompiledShaders</Filter>
</ClCompile>
<ClCompile Include="CompiledShaders\DrawQuadRGBP_ICC_D3D11.cpp">
<Filter>Source Files\CompiledShaders</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="GpDisplayDriverD3D11.h">

View File

@@ -76,6 +76,11 @@ void GpInputDriverXInput::Shutdown()
free(this);
}
IGpPrefsHandler *GpInputDriverXInput::GetPrefsHandler() const
{
return nullptr;
}
GpInputDriverXInput *GpInputDriverXInput::Create(const GpInputDriverProperties &props)
{
void *storage = malloc(sizeof(GpInputDriverXInput));

View File

@@ -13,6 +13,8 @@ public:
void ProcessInput() override;
void Shutdown() override;
IGpPrefsHandler *GetPrefsHandler() const override;
static GpInputDriverXInput *Create(const GpInputDriverProperties &props);
private:

View File

@@ -1,6 +1,6 @@
rmdir /S /Q ReleasePkg
mkdir ReleasePkg\PDBs
mkdir ReleasePkg
mkdir ReleasePkg\Aerofoil
mkdir ReleasePkg\Aerofoil\Packaged
@@ -9,6 +9,7 @@ mkdir ReleasePkg\Aerofoil\Tools
copy /Y x64\Release\Aerofoil.exe ReleasePkg\Aerofoil
copy /Y x64\Release\GpAudioDriver_XAudio2.dll ReleasePkg\Aerofoil
copy /Y x64\Release\xaudio2_9redist.dll ReleasePkg\Aerofoil
copy /Y x64\Release\GpDisplayDriver_D3D11.dll ReleasePkg\Aerofoil
copy /Y x64\Release\GpInputDriver_XInput.dll ReleasePkg\Aerofoil
copy /Y x64\Release\FreeType.dll ReleasePkg\Aerofoil
@@ -23,8 +24,23 @@ copy /Y x64\Release\FTagData.exe ReleasePkg\Aerofoil\Tools
copy /Y x64\Release\gpr2gpa.exe ReleasePkg\Aerofoil\Tools
copy /Y x64\Release\unpacktool.exe ReleasePkg\Aerofoil\Tools
mkdir ReleasePkg\PDBs
copy /Y x64\Release\*.pdb ReleasePkg\PDBs
copy /Y x64\Release\Aerofoil.pdb ReleasePkg\PDBs
copy /Y x64\Release\GpAudioDriver_XAudio2.pdb ReleasePkg\PDBs
copy /Y x64\Release\GpDisplayDriver_D3D11.pdb ReleasePkg\PDBs
copy /Y x64\Release\GpInputDriver_XInput.pdb ReleasePkg\PDBs
copy /Y x64\Release\FreeType.pdb ReleasePkg\PDBs
copy /Y x64\Release\GpApp.pdb ReleasePkg\PDBs
copy /Y x64\Release\flattenmov.pdb ReleasePkg\PDBs
copy /Y x64\Release\bin2gp.pdb ReleasePkg\PDBs
copy /Y x64\Release\hqx2bin.pdb ReleasePkg\PDBs
copy /Y x64\Release\hqx2gp.pdb ReleasePkg\PDBs
copy /Y x64\Release\MakeTimestamp.pdb ReleasePkg\PDBs
copy /Y x64\Release\FTagData.pdb ReleasePkg\PDBs
copy /Y x64\Release\gpr2gpa.pdb ReleasePkg\PDBs
copy /Y x64\Release\unpacktool.pdb ReleasePkg\PDBs
xcopy /I /E /Y /K Packaged ReleasePkg\Aerofoil\Packaged
xcopy /I /E /Y /K Resources ReleasePkg\Aerofoil\Resources

View File

@@ -0,0 +1,6 @@
move ReleasePkg\en-us\Aerofoil-installpkg.msi ReleasePkg\Aerofoil-installpkg.msi
Tools\7z.exe a -bd -r -mx=9 ReleasePkg\Aerofoil.zip ReleasePkg\Aerofoil
Tools\7z.exe a -bd -r -mx=9 ReleasePkg\Aerofoil-PDBs.7z ReleasePkg\PDBs
rmdir /S /Q ReleasePkg\Aerofoil
rmdir /S /Q ReleasePkg\en-us
rmdir /S /Q ReleasePkg\PDBs

View File

@@ -1,20 +0,0 @@
#pragma once
#ifndef __PL_AE_HANDLER_DESC_H__
#define __PL_AE_HANDLER_DESC_H__
#include "PLAppleEventsCommonTypes.h"
#include <stdint.h>
namespace PortabilityLayer
{
struct AEHandlerDesc
{
AEEventClass m_eventClass;
AEEventID m_eventID;
AEEventHandler m_handler;
uint32_t m_ref;
};
}
#endif

View File

@@ -1,73 +0,0 @@
#include "AEManager.h"
#include "AEHandlerDesc.h"
#include <vector>
namespace PortabilityLayer
{
class AEManagerImpl final : public AEManager
{
public:
AEManagerImpl();
void Init() override;
void Shutdown() override;
void InstallEventHandler(AEEventClass eventClass, AEEventID eventID, AEEventHandler handler, uint32_t ref, bool isSysHandler) override;
void SetInteractAllowed(AEInteractAllowed interactAllowed) override;
static AEManagerImpl *GetInstance();
private:
std::vector<AEHandlerDesc> m_handlers;
AEInteractAllowed m_interactAllowed;
static AEManagerImpl ms_instance;
};
AEManagerImpl::AEManagerImpl()
: m_interactAllowed(kAEInteractUnknown)
{
}
void AEManagerImpl::Init()
{
m_interactAllowed = kAEInteractUnknown;
}
void AEManagerImpl::Shutdown()
{
m_handlers.clear();
}
void AEManagerImpl::InstallEventHandler(AEEventClass eventClass, AEEventID eventID, AEEventHandler handler, uint32_t ref, bool isSysHandler)
{
AEHandlerDesc desc;
desc.m_eventClass = eventClass;
desc.m_eventID = eventID;
desc.m_handler = handler;
desc.m_ref = ref;
m_handlers.push_back(desc);
}
void AEManagerImpl::SetInteractAllowed(AEInteractAllowed interactAllowed)
{
m_interactAllowed = interactAllowed;
}
AEManagerImpl *AEManagerImpl::GetInstance()
{
return &ms_instance;
}
AEManagerImpl AEManagerImpl::ms_instance;
AEManager *AEManager::GetInstance()
{
return AEManagerImpl::GetInstance();
}
}

View File

@@ -1,24 +0,0 @@
#pragma once
#ifndef __PL_AE_MANAGER_H__
#define __PL_AE_MANAGER_H__
#include "PLAppleEventsCommonTypes.h"
#include <stdint.h>
namespace PortabilityLayer
{
class AEManager
{
public:
virtual void Init() = 0;
virtual void Shutdown() = 0;
virtual void InstallEventHandler(AEEventClass eventClass, AEEventID eventID, AEEventHandler handler, uint32_t ref, bool isSysHandler) = 0;
virtual void SetInteractAllowed(AEInteractAllowed interactAllowed) = 0;
static AEManager *GetInstance();
};
}
#endif

View File

@@ -1,6 +1,9 @@
#include "AntiAliasTable.h"
#include "RGBAColor.h"
#include <algorithm>
#include <math.h>
// TODO: This is not gamma correct...
namespace PortabilityLayer
{
@@ -116,5 +119,29 @@ namespace PortabilityLayer
}
}
}
void AntiAliasTable::GenerateForSimpleScale(uint8_t colorChannel)
{
const double gamma = 1.8;
const double rcpGamma = 1.0 / gamma;
const double rcp255 = 1.0 / 255.0;
const double rcp15 = 1.0 / 15.0;
double colorChannelLinear = pow(colorChannel * rcp255, gamma);
for (size_t baseColor = 0; baseColor < 256; baseColor++)
{
const double baseColorLinear = pow(baseColor * rcp255, gamma);
for (size_t opacity = 0; opacity < 16; opacity++)
{
const double opacityF = static_cast<double>(opacity) * rcp15;
const double blendedColor = colorChannelLinear * opacityF + (1.0 - opacityF) * baseColorLinear;
const double blendedColorGammaSpace = pow(std::min(std::max(0.0, blendedColor), 1.0), rcpGamma);
m_aaTranslate[baseColor][opacity] = static_cast<uint8_t>(floor(blendedColorGammaSpace * 255.0 + 0.5));
}
}
}
#endif
}

View File

@@ -1,16 +1,17 @@
#pragma once
#include <stdint.h>
#include <stdint.h>
namespace PortabilityLayer
{
struct RGBAColor;
struct AntiAliasTable
struct AntiAliasTable
{
// Striped 256x16 because constant background color is more likely than constant sample
uint8_t m_aaTranslate[256][16];
void GenerateForPalette(const RGBAColor &baseColor, const RGBAColor *colors, size_t numColors);
void GenerateForSimpleScale(uint8_t colorChannel);
};
}

View File

@@ -1,117 +1,117 @@
#include "CFileStream.h"
namespace PortabilityLayer
{
CFileStream::CFileStream(FILE *f)
: m_file(f)
, m_readOnly(false)
, m_writeOnly(false)
, m_seekable(true)
{
}
CFileStream::CFileStream(FILE *f, bool isReadOnly, bool isWriteOnly, bool isSeekable)
: m_file(f)
, m_readOnly(isReadOnly)
, m_writeOnly(isWriteOnly)
, m_seekable(isSeekable)
{
}
size_t CFileStream::Read(void *bytesOut, size_t size)
{
if (!m_file || m_writeOnly)
return 0;
return fread(bytesOut, 1, size, m_file);
}
size_t CFileStream::Write(const void *bytes, size_t size)
{
if (!m_file || m_readOnly)
return 0;
return fwrite(bytes, 1, size, m_file);
}
bool CFileStream::IsSeekable() const
{
return m_seekable;
}
bool CFileStream::IsReadOnly() const
{
return m_readOnly;
}
bool CFileStream::IsWriteOnly() const
{
return m_writeOnly;
}
bool CFileStream::SeekStart(UFilePos_t loc)
{
if (!m_file)
return false;
return fseek(m_file, static_cast<long>(loc), SEEK_SET) == 0;
}
bool CFileStream::SeekCurrent(FilePos_t loc)
{
if (!m_file)
return false;
return fseek(m_file, static_cast<long>(loc), SEEK_CUR) == 0;;
}
bool CFileStream::SeekEnd(UFilePos_t loc)
{
if (!m_file)
return false;
return fseek(m_file, static_cast<long>(loc), SEEK_END) == 0;
}
bool CFileStream::Truncate(UFilePos_t loc)
{
return false;
}
UFilePos_t CFileStream::Tell() const
{
if (!m_file)
return 0;
return static_cast<UFilePos_t>(ftell(m_file));
}
void CFileStream::Close()
{
if (m_file)
{
fclose(m_file);
m_file = nullptr;
}
#include "CFileStream.h"
namespace PortabilityLayer
{
CFileStream::CFileStream(FILE *f)
: m_file(f)
, m_readOnly(false)
, m_writeOnly(false)
, m_seekable(true)
{
}
CFileStream::CFileStream(FILE *f, bool isReadOnly, bool isWriteOnly, bool isSeekable)
: m_file(f)
, m_readOnly(isReadOnly)
, m_writeOnly(isWriteOnly)
, m_seekable(isSeekable)
{
}
size_t CFileStream::Read(void *bytesOut, size_t size)
{
if (!m_file || m_writeOnly)
return 0;
return fread(bytesOut, 1, size, m_file);
}
size_t CFileStream::Write(const void *bytes, size_t size)
{
if (!m_file || m_readOnly)
return 0;
return fwrite(bytes, 1, size, m_file);
}
bool CFileStream::IsSeekable() const
{
return m_seekable;
}
bool CFileStream::IsReadOnly() const
{
return m_readOnly;
}
bool CFileStream::IsWriteOnly() const
{
return m_writeOnly;
}
bool CFileStream::SeekStart(UFilePos_t loc)
{
if (!m_file)
return false;
return fseek(m_file, static_cast<long>(loc), SEEK_SET) == 0;
}
bool CFileStream::SeekCurrent(FilePos_t loc)
{
if (!m_file)
return false;
return fseek(m_file, static_cast<long>(loc), SEEK_CUR) == 0;;
}
bool CFileStream::SeekEnd(UFilePos_t loc)
{
if (!m_file)
return false;
return fseek(m_file, static_cast<long>(loc), SEEK_END) == 0;
}
bool CFileStream::Truncate(UFilePos_t loc)
{
return false;
}
UFilePos_t CFileStream::Tell() const
{
if (!m_file)
return 0;
return static_cast<UFilePos_t>(ftell(m_file));
}
void CFileStream::Close()
{
if (m_file)
{
fclose(m_file);
m_file = nullptr;
}
}
void CFileStream::Flush()
{
{
if (m_file)
fflush(m_file);
}
UFilePos_t CFileStream::Size() const
{
if (!m_file || !m_seekable)
return 0;
long oldPos = ftell(m_file);
fseek(m_file, 0, SEEK_END);
const UFilePos_t endPos = static_cast<UFilePos_t>(ftell(m_file));
fseek(m_file, oldPos, SEEK_SET);
return endPos;
}
}
fflush(m_file);
}
UFilePos_t CFileStream::Size() const
{
if (!m_file || !m_seekable)
return 0;
long oldPos = ftell(m_file);
fseek(m_file, 0, SEEK_END);
const UFilePos_t endPos = static_cast<UFilePos_t>(ftell(m_file));
fseek(m_file, oldPos, SEEK_SET);
return endPos;
}
}

View File

@@ -1,43 +1,43 @@
#pragma once
#ifndef __PL_CFILESTREAM_H__
#define __PL_CFILESTREAM_H__
#include <stdio.h>
#include "CoreDefs.h"
#include "IOStream.h"
namespace PortabilityLayer
{
class CFileStream final : public IOStream
{
public:
explicit CFileStream(FILE *f);
CFileStream(FILE *f, bool isReadOnly, bool isWriteOnly, bool isSeekable);
size_t Read(void *bytesOut, size_t size) override;
size_t Write(const void *bytes, size_t size) override;
bool IsSeekable() const override;
bool IsReadOnly() const override;
bool IsWriteOnly() const override;
bool SeekStart(UFilePos_t loc) override;
bool SeekCurrent(FilePos_t loc) override;
bool SeekEnd(UFilePos_t loc) override;
bool Truncate(UFilePos_t loc) override;
UFilePos_t Size() const override;
UFilePos_t Tell() const override;
#pragma once
#ifndef __PL_CFILESTREAM_H__
#define __PL_CFILESTREAM_H__
#include <stdio.h>
#include "CoreDefs.h"
#include "IOStream.h"
namespace PortabilityLayer
{
class CFileStream final : public IOStream
{
public:
explicit CFileStream(FILE *f);
CFileStream(FILE *f, bool isReadOnly, bool isWriteOnly, bool isSeekable);
size_t Read(void *bytesOut, size_t size) override;
size_t Write(const void *bytes, size_t size) override;
bool IsSeekable() const override;
bool IsReadOnly() const override;
bool IsWriteOnly() const override;
bool SeekStart(UFilePos_t loc) override;
bool SeekCurrent(FilePos_t loc) override;
bool SeekEnd(UFilePos_t loc) override;
bool Truncate(UFilePos_t loc) override;
UFilePos_t Size() const override;
UFilePos_t Tell() const override;
void Close() override;
void Flush() override;
private:
CFileStream(const CFileStream &other) GP_DELETED;
FILE *m_file;
bool m_readOnly;
bool m_writeOnly;
bool m_seekable;
};
}
#endif
void Flush() override;
private:
CFileStream(const CFileStream &other) GP_DELETED;
FILE *m_file;
bool m_readOnly;
bool m_writeOnly;
bool m_seekable;
};
}
#endif

View File

@@ -611,15 +611,15 @@ namespace PortabilityLayer
{
public:
Dialog *LoadDialog(int16_t resID, Window *behindWindow, const DialogTextSubstitutions *substitutions) override;
Dialog *LoadDialogFromTemplate(int16_t templateResID, const Rect &rect, bool visible, bool hasCloseBox, uint32_t referenceConstant, uint16_t positionSpec, Window *behindWindow, const PLPasStr &title, const DialogTextSubstitutions *substitutions) override;
int16_t DisplayAlert(int16_t alertResID, const DialogTextSubstitutions *substitutions) override;
void PositionWindow(Window *window, const Rect &rect) const override;
DialogTemplate *LoadDialogTemplate(int16_t resID);
static DialogManagerImpl *GetInstance();
private:
void PositionWindow(Window *window, const Rect &rect);
Dialog *LoadDialogFromTemplate(int16_t templateResID, const Rect &rect, bool visible, bool hasCloseBox, uint32_t referenceConstant, uint16_t positionSpec, Window *behindWindow, const PLPasStr &title, const DialogTextSubstitutions *substitutions);
static int16_t AlertFilter(Dialog *dialog, const TimeTaggedVOSEvent *evt);
@@ -827,10 +827,10 @@ namespace PortabilityLayer
return dtemplate;
}
void DialogManagerImpl::PositionWindow(Window *window, const Rect &rect)
void DialogManagerImpl::PositionWindow(Window *window, const Rect &rect) const
{
unsigned int displayWidth, displayHeight;
PortabilityLayer::HostDisplayDriver::GetInstance()->GetDisplayResolution(&displayWidth, &displayHeight, nullptr);
PortabilityLayer::HostDisplayDriver::GetInstance()->GetDisplayResolution(&displayWidth, &displayHeight);
const unsigned int halfDisplayHeight = displayHeight / 2;
const unsigned int quarterDisplayWidth = displayHeight / 4;

View File

@@ -4,8 +4,10 @@
struct Dialog;
struct DialogTextSubstitutions;
struct Rect;
struct Window;
struct TimeTaggedVOSEvent;
class PLPasStr;
namespace PortabilityLayer
{
@@ -16,7 +18,9 @@ namespace PortabilityLayer
{
public:
virtual Dialog *LoadDialog(int16_t resID, Window *behindWindow, const DialogTextSubstitutions *substitutions) = 0;
virtual Dialog *LoadDialogFromTemplate(int16_t templateResID, const Rect &rect, bool visible, bool hasCloseBox, uint32_t referenceConstant, uint16_t positionSpec, Window *behindWindow, const PLPasStr &title, const DialogTextSubstitutions *substitutions) = 0;
virtual int16_t DisplayAlert(int16_t alertResID, const DialogTextSubstitutions *substitutions) = 0;
virtual void PositionWindow(Window *window, const Rect &rect) const = 0;
static DialogManager *GetInstance();
};

View File

@@ -16,6 +16,7 @@ namespace PortabilityLayer
void Init() override;
void Shutdown() override;
void SetPixelFormat(GpPixelFormat_t pixelFormat) override;
GpPixelFormat_t GetPixelFormat() const override;
void SyncPalette(IGpDisplayDriver *displayDriver) override;
@@ -62,8 +63,6 @@ namespace PortabilityLayer
void DisplayDeviceManagerImpl::Init()
{
HostDisplayDriver::GetInstance()->GetDisplayResolution(nullptr, nullptr, &m_pixelFormat);
const PortabilityLayer::RGBAColor *spColors = StandardPalette::GetInstance()->GetColors();
for (size_t i = 0; i < 256; i++)
m_palette[i] = spColors[i];
@@ -75,6 +74,11 @@ namespace PortabilityLayer
{
}
void DisplayDeviceManagerImpl::SetPixelFormat(GpPixelFormat_t pixelFormat)
{
m_pixelFormat = pixelFormat;
}
GpPixelFormat_t DisplayDeviceManagerImpl::GetPixelFormat() const
{
return m_pixelFormat;

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