Implement popup sprite

This commit is contained in:
sigonasr2 2025-08-22 21:24:02 -05:00
parent 77d5415627
commit 454654bab7
8 changed files with 114 additions and 65 deletions

View File

@ -1,67 +1,44 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36221.1 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Shep", "Shep.vcxproj", "{5098E9D5-277F-32D4-A895-58182C4B4817}"
ProjectSection(ProjectDependencies) = postProject
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D} = {B7B3633A-711E-3F6B-BA79-9E7EB215D66D}
{019AAA8C-E480-3778-81D8-B6CCCA60A695} = {019AAA8C-E480-3778-81D8-B6CCCA60A695}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", "ALL_BUILD.vcxproj", "{33E51337-098E-3A7D-B8DC-E22B20F396A1}"
ProjectSection(ProjectDependencies) = postProject
{5098E9D5-277F-32D4-A895-58182C4B4817} = {5098E9D5-277F-32D4-A895-58182C4B4817}
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D} = {B7B3633A-711E-3F6B-BA79-9E7EB215D66D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{B7B3633A-711E-3F6B-BA79-9E7EB215D66D}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy_data", "copy_data.vcxproj", "{019AAA8C-E480-3778-81D8-B6CCCA60A695}"
ProjectSection(ProjectDependencies) = postProject
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D} = {B7B3633A-711E-3F6B-BA79-9E7EB215D66D}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
MinSizeRel|x64 = MinSizeRel|x64
Release|x64 = Release|x64
RelWithDebInfo|x64 = RelWithDebInfo|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5098E9D5-277F-32D4-A895-58182C4B4817}.Debug|x64.ActiveCfg = Debug|x64
{5098E9D5-277F-32D4-A895-58182C4B4817}.Debug|x64.Build.0 = Debug|x64
{5098E9D5-277F-32D4-A895-58182C4B4817}.Release|x64.ActiveCfg = Release|x64
{5098E9D5-277F-32D4-A895-58182C4B4817}.Release|x64.Build.0 = Release|x64
{5098E9D5-277F-32D4-A895-58182C4B4817}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{5098E9D5-277F-32D4-A895-58182C4B4817}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{5098E9D5-277F-32D4-A895-58182C4B4817}.Release|x64.ActiveCfg = Release|x64
{5098E9D5-277F-32D4-A895-58182C4B4817}.Release|x64.Build.0 = Release|x64
{5098E9D5-277F-32D4-A895-58182C4B4817}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{5098E9D5-277F-32D4-A895-58182C4B4817}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{33E51337-098E-3A7D-B8DC-E22B20F396A1}.Debug|x64.ActiveCfg = Debug|x64
{33E51337-098E-3A7D-B8DC-E22B20F396A1}.Release|x64.ActiveCfg = Release|x64
{33E51337-098E-3A7D-B8DC-E22B20F396A1}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{33E51337-098E-3A7D-B8DC-E22B20F396A1}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D}.Debug|x64.ActiveCfg = Debug|x64
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D}.Debug|x64.Build.0 = Debug|x64
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D}.Release|x64.ActiveCfg = Release|x64
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D}.Release|x64.Build.0 = Release|x64
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D}.Release|x64.ActiveCfg = Release|x64
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D}.Release|x64.Build.0 = Release|x64
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{B7B3633A-711E-3F6B-BA79-9E7EB215D66D}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{019AAA8C-E480-3778-81D8-B6CCCA60A695}.Debug|x64.ActiveCfg = Debug|x64
{019AAA8C-E480-3778-81D8-B6CCCA60A695}.Debug|x64.Build.0 = Debug|x64
{019AAA8C-E480-3778-81D8-B6CCCA60A695}.Release|x64.ActiveCfg = Release|x64
{019AAA8C-E480-3778-81D8-B6CCCA60A695}.Release|x64.Build.0 = Release|x64
{019AAA8C-E480-3778-81D8-B6CCCA60A695}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{019AAA8C-E480-3778-81D8-B6CCCA60A695}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{019AAA8C-E480-3778-81D8-B6CCCA60A695}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{019AAA8C-E480-3778-81D8-B6CCCA60A695}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {59395CD5-980E-35D5-B29E-CE56D7A53173}
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@ -362,12 +362,6 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</ProjectReference>
<ProjectReference Include="J:\Shep\copy_data.vcxproj">
<Project>{019AAA8C-E480-3778-81D8-B6CCCA60A695}</Project>
<Name>copy_data</Name>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\miniaudio.h" />

View File

@ -22,11 +22,11 @@
<UniqueIdentifier>{A82673E5-F5F2-3F70-A0C3-48F1497712FD}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{0c5bef0d-5dd7-4faa-aa34-7631c042553a}</UniqueIdentifier>
<UniqueIdentifier>{7e52ea5d-4b03-4ec0-80f8-5dd9e7638d96}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\miniaudio.h">
<ClInclude Include="include\olcPGEX_Graphics3D.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\olcPGEX_MiniAudio.h">
@ -38,7 +38,7 @@
<ClInclude Include="include\olcUTIL_Geometry2D.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\olcPGEX_Graphics3D.h">
<ClInclude Include="include\miniaudio.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="util.h">

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -160,6 +160,62 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">false</LinkObjects>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="J:\Shep\assets\gfx\nico-Trapper_512.png">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating bin/assets/gfx/nico-Trapper_512.png</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">setlocal
"C:\Program Files\CMake\bin\cmake.exe" -E copy J:/Shep/assets/gfx/nico-Trapper_512.png J:/Shep/bin/assets/gfx/nico-Trapper_512.png
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">J:\Shep\bin\assets\gfx\nico-Trapper_512.png</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkObjects>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating bin/assets/gfx/nico-Trapper_512.png</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">setlocal
"C:\Program Files\CMake\bin\cmake.exe" -E copy J:/Shep/assets/gfx/nico-Trapper_512.png J:/Shep/bin/assets/gfx/nico-Trapper_512.png
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">J:\Shep\bin\assets\gfx\nico-Trapper_512.png</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkObjects>
<Message Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">Generating bin/assets/gfx/nico-Trapper_512.png</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">setlocal
"C:\Program Files\CMake\bin\cmake.exe" -E copy J:/Shep/assets/gfx/nico-Trapper_512.png J:/Shep/bin/assets/gfx/nico-Trapper_512.png
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">J:\Shep\bin\assets\gfx\nico-Trapper_512.png</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">false</LinkObjects>
<Message Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">Generating bin/assets/gfx/nico-Trapper_512.png</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">setlocal
"C:\Program Files\CMake\bin\cmake.exe" -E copy J:/Shep/assets/gfx/nico-Trapper_512.png J:/Shep/bin/assets/gfx/nico-Trapper_512.png
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">J:\Shep\bin\assets\gfx\nico-Trapper_512.png</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">false</LinkObjects>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="J:\Shep\assets\gfx\space.png">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating bin/assets/gfx/space.png</Message>
@ -506,7 +562,7 @@ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">J:\Shep\bin\assets\.keepme;J:\Shep\bin\assets\gfx\space.png;J:\Shep\bin\assets\sounds\Explosions1.wav;J:\Shep\bin\assets\sounds\Laser_Shoot11.wav;J:\Shep\bin\assets\sounds\bg-music.wav;J:\Shep\bin\assets\sounds\lose9.wav;J:\Shep\bin\assets\sounds\thruster.wav;%(AdditionalInputs)</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">J:\Shep\bin\assets\.keepme;J:\Shep\bin\assets\gfx\nico-Trapper_512.png;J:\Shep\bin\assets\gfx\space.png;J:\Shep\bin\assets\sounds\Explosions1.wav;J:\Shep\bin\assets\sounds\Laser_Shoot11.wav;J:\Shep\bin\assets\sounds\bg-music.wav;J:\Shep\bin\assets\sounds\lose9.wav;J:\Shep\bin\assets\sounds\thruster.wav;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">J:\Shep\CMakeFiles\copy_data</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkObjects>
<VerifyInputsAndOutputsExist Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</VerifyInputsAndOutputsExist>
@ -518,7 +574,7 @@ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">J:\Shep\bin\assets\.keepme;J:\Shep\bin\assets\gfx\space.png;J:\Shep\bin\assets\sounds\Explosions1.wav;J:\Shep\bin\assets\sounds\Laser_Shoot11.wav;J:\Shep\bin\assets\sounds\bg-music.wav;J:\Shep\bin\assets\sounds\lose9.wav;J:\Shep\bin\assets\sounds\thruster.wav;%(AdditionalInputs)</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">J:\Shep\bin\assets\.keepme;J:\Shep\bin\assets\gfx\nico-Trapper_512.png;J:\Shep\bin\assets\gfx\space.png;J:\Shep\bin\assets\sounds\Explosions1.wav;J:\Shep\bin\assets\sounds\Laser_Shoot11.wav;J:\Shep\bin\assets\sounds\bg-music.wav;J:\Shep\bin\assets\sounds\lose9.wav;J:\Shep\bin\assets\sounds\thruster.wav;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">J:\Shep\CMakeFiles\copy_data</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkObjects>
<VerifyInputsAndOutputsExist Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</VerifyInputsAndOutputsExist>
@ -530,7 +586,7 @@ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">J:\Shep\bin\assets\.keepme;J:\Shep\bin\assets\gfx\space.png;J:\Shep\bin\assets\sounds\Explosions1.wav;J:\Shep\bin\assets\sounds\Laser_Shoot11.wav;J:\Shep\bin\assets\sounds\bg-music.wav;J:\Shep\bin\assets\sounds\lose9.wav;J:\Shep\bin\assets\sounds\thruster.wav;%(AdditionalInputs)</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">J:\Shep\bin\assets\.keepme;J:\Shep\bin\assets\gfx\nico-Trapper_512.png;J:\Shep\bin\assets\gfx\space.png;J:\Shep\bin\assets\sounds\Explosions1.wav;J:\Shep\bin\assets\sounds\Laser_Shoot11.wav;J:\Shep\bin\assets\sounds\bg-music.wav;J:\Shep\bin\assets\sounds\lose9.wav;J:\Shep\bin\assets\sounds\thruster.wav;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">J:\Shep\CMakeFiles\copy_data</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">false</LinkObjects>
<VerifyInputsAndOutputsExist Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">false</VerifyInputsAndOutputsExist>
@ -542,7 +598,7 @@ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">J:\Shep\bin\assets\.keepme;J:\Shep\bin\assets\gfx\space.png;J:\Shep\bin\assets\sounds\Explosions1.wav;J:\Shep\bin\assets\sounds\Laser_Shoot11.wav;J:\Shep\bin\assets\sounds\bg-music.wav;J:\Shep\bin\assets\sounds\lose9.wav;J:\Shep\bin\assets\sounds\thruster.wav;%(AdditionalInputs)</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">J:\Shep\bin\assets\.keepme;J:\Shep\bin\assets\gfx\nico-Trapper_512.png;J:\Shep\bin\assets\gfx\space.png;J:\Shep\bin\assets\sounds\Explosions1.wav;J:\Shep\bin\assets\sounds\Laser_Shoot11.wav;J:\Shep\bin\assets\sounds\bg-music.wav;J:\Shep\bin\assets\sounds\lose9.wav;J:\Shep\bin\assets\sounds\thruster.wav;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">J:\Shep\CMakeFiles\copy_data</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">false</LinkObjects>
<VerifyInputsAndOutputsExist Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">false</VerifyInputsAndOutputsExist>

View File

@ -2,6 +2,9 @@
<Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<CustomBuild Include="J:\Shep\assets\.keepme" />
<CustomBuild Include="J:\Shep\assets\gfx\nico-Trapper_512.png">
<Filter>Resources</Filter>
</CustomBuild>
<CustomBuild Include="J:\Shep\assets\gfx\space.png">
<Filter>Resources</Filter>
</CustomBuild>

View File

@ -867,6 +867,7 @@ namespace olc
enum class GFX3DTransform
{
POPUP_SPRITE,
TRANSFORM_REQUIRED,
NO_TRANSFORM
};
@ -2891,7 +2892,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.transform=transform;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
@ -2922,7 +2923,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.transform=transform;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
@ -2952,7 +2953,7 @@ namespace olc
di.structure = nDecalStructure;
di.transform=transform;
di.z = {z,z,z,z};
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
@ -2994,7 +2995,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.transform=transform;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
@ -3018,7 +3019,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.transform=transform;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
@ -3042,7 +3043,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.transform=transform;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
@ -3075,7 +3076,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.transform=transform;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
@ -3099,7 +3100,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.transform=transform;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
@ -3127,7 +3128,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = DecalStructure::LIST;
di.depth = true;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
@ -3170,7 +3171,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.depth = true;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
}
@ -3284,7 +3285,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.transform=transform;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
@ -3316,7 +3317,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.transform=transform;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
@ -3352,7 +3353,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.transform=transform;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
}
@ -3387,7 +3388,7 @@ namespace olc
di.mode = nDecalMode;
di.structure = nDecalStructure;
di.transform=transform;
if(transform==GFX3DTransform::TRANSFORM_REQUIRED)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
if(transform==GFX3DTransform::TRANSFORM_REQUIRED||transform==GFX3DTransform::POPUP_SPRITE)vLayers[nTargetLayer].vecDecalInstance.emplace_back(di);
else vLayers[nTargetLayer].vecForegroundDecalInstance.emplace_back(di);
}
}

View File

@ -15,17 +15,19 @@ public:
const vi2d SCREEN_SIZE{256,192};
Renderable space;
Renderable space,nico;
GFX3D::PipeLine renderer;
GFX3D::vec3d vUp{0,-1,0};
GFX3D::vec3d vUp{0,0,1};
GFX3D::vec3d vEye{0.f,-5.f,2.f};
GFX3D::vec3d vLookDir{0,0,-1};
GFX3D::mat4x4 camRot{GFX3D::Math::Mat_MakeRotationX(util::degToRad(5))};
GFX3D::vec3d vLookDir{GFX3D::Math::Mat_MultiplyVector(camRot,{0,0,-1})};
bool OnUserCreate() override
{
olc::GFX3D::ConfigureDisplay();
renderer.SetProjection(90.0f, (float)SCREEN_SIZE.x/(float)SCREEN_SIZE.y, 0.1f, 1000.0f, 0, SCREEN_SIZE.y, 512, SCREEN_SIZE.y);
space.Load("assets/gfx/space.png");
nico.Load("assets/gfx/nico-Trapper_512.png");
return true;
}
@ -33,6 +35,16 @@ public:
{
DrawDecal({},space.Decal(),{1.f,1.f},WHITE,olc::GFX3DTransform::TRANSFORM_REQUIRED);
DrawDecal({},nico.Decal(),{1.f,1.f},WHITE,olc::GFX3DTransform::POPUP_SPRITE);
if(GetKey(LEFT).bHeld)vEye.x-=fElapsedTime*5;
if(GetKey(RIGHT).bHeld)vEye.x+=fElapsedTime*5;
if(GetKey(UP).bHeld)vEye.z+=fElapsedTime*5;
if(GetKey(DOWN).bHeld)vEye.z-=fElapsedTime*5;
if(GetKey(PGUP).bHeld)vEye.y+=fElapsedTime*5;
if(GetKey(PGDN).bHeld)vEye.y-=fElapsedTime*5;
return true;
}
virtual void Apply3DTransform(std::vector<DecalInstance>&decals)override{
@ -68,8 +80,14 @@ public:
renderer.Render({tri},decal.decal,GFX3D::RENDER_TEXTURED|GFX3D::RENDER_DEPTH);
}
}else if(decal.points==4){
GFX3D::triangle tri{{{decal.pos[0].x,decal.pos[0].y,decal.z[0],1.f},{decal.pos[1].x,decal.pos[1].y,decal.z[1],1.f},{decal.pos[2].x,decal.pos[2].y,decal.z[2],1.f}},{{decal.uv[0].x,decal.uv[0].y,0.f},{decal.uv[1].x,decal.uv[1].y,0.f},{decal.uv[2].x,decal.uv[2].y,0.f}},{decal.tint[0],decal.tint[1],decal.tint[2]}};
GFX3D::triangle tri2{{{decal.pos[0].x,decal.pos[0].y,decal.z[0],1.f},{decal.pos[2].x,decal.pos[2].y,decal.z[2],1.f},{decal.pos[3].x,decal.pos[3].y,decal.z[3],1.f}},{{decal.uv[0].x,decal.uv[0].y,0.f},{decal.uv[2].x,decal.uv[2].y,0.f},{decal.uv[3].x,decal.uv[3].y,0.f}},{decal.tint[0],decal.tint[2],decal.tint[3]}};
GFX3D::triangle tri,tri2;
if(decal.transform==GFX3DTransform::POPUP_SPRITE){ //Orientation is lower-left clockwise
tri={{{decal.pos[0].x,decal.pos[0].y,decal.z[0],1.f},{decal.pos[1].x,decal.pos[1].y,decal.decal->sprite->height+decal.z[1],1.f},{decal.pos[2].x,decal.pos[2].y,decal.decal->sprite->height+decal.z[2],1.f}},{{decal.uv[0].x,decal.uv[0].y,0.f},{decal.uv[1].x,decal.uv[1].y,0.f},{decal.uv[2].x,decal.uv[2].y,0.f}},{decal.tint[0],decal.tint[1],decal.tint[2]}};
tri2={{{decal.pos[0].x,decal.pos[0].y,decal.decal->sprite->height+decal.z[0],1.f},{decal.pos[2].x,decal.pos[2].y,decal.decal->sprite->height+decal.z[2],1.f},{decal.pos[3].x,decal.pos[3].y,decal.z[3],1.f}},{{decal.uv[0].x,decal.uv[0].y,0.f},{decal.uv[2].x,decal.uv[2].y,0.f},{decal.uv[3].x,decal.uv[3].y,0.f}},{decal.tint[0],decal.tint[2],decal.tint[3]}};
}else{
tri={{{decal.pos[0].x,decal.pos[0].y,decal.z[0],1.f},{decal.pos[1].x,decal.pos[1].y,decal.z[1],1.f},{decal.pos[2].x,decal.pos[2].y,decal.z[2],1.f}},{{decal.uv[0].x,decal.uv[0].y,0.f},{decal.uv[1].x,decal.uv[1].y,0.f},{decal.uv[2].x,decal.uv[2].y,0.f}},{decal.tint[0],decal.tint[1],decal.tint[2]}};
tri2={{{decal.pos[0].x,decal.pos[0].y,decal.z[0],1.f},{decal.pos[2].x,decal.pos[2].y,decal.z[2],1.f},{decal.pos[3].x,decal.pos[3].y,decal.z[3],1.f}},{{decal.uv[0].x,decal.uv[0].y,0.f},{decal.uv[2].x,decal.uv[2].y,0.f},{decal.uv[3].x,decal.uv[3].y,0.f}},{decal.tint[0],decal.tint[2],decal.tint[3]}};
}
tri.p[0].z+=zIncrementer;
tri.p[1].z+=zIncrementer;
tri.p[2].z+=zIncrementer;