Merge branch 'UWP_GLES2' into sdl-gpu_test
This commit is contained in:
commit
bf2e44d118
|
@ -115,3 +115,10 @@ build/windows/sdl-gpu/Debug/
|
|||
build/windows/sdl-gpu/Debug Pro/
|
||||
build/windows/sdl-gpu/Release/
|
||||
build/windows/sdl-gpu/Release Pro/
|
||||
build/uwp/sdl-gpu-static/Debug/
|
||||
build/uwp/sdl-gpu-static/Debug Pro/
|
||||
build/uwp/sdl-gpu-static/Release/
|
||||
build/uwp/sdl-gpu-static/Release Pro/
|
||||
build/uwp/sdl-gpu-static/ARM/
|
||||
build/uwp/sdl-gpu-static/x64/
|
||||
build/uwp/tic/packages/
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit f9e108123796f9bb8bbe6c8b87239bb09fec14d0
|
||||
Subproject commit c326432f2ca415f4c63268a8ebff2221e03038e7
|
|
@ -0,0 +1,220 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\externals\stb_image\stb_image.c" />
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\externals\stb_image_write\stb_image_write.c" />
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\renderer_GLES_2.c" />
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\SDL_gpu.c" />
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\SDL_gpu_matrix.c" />
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\SDL_gpu_renderer.c" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{361dfddb-f86e-4c2c-abee-03acf4b8ac33}</ProjectGuid>
|
||||
<Keyword>StaticLibrary</Keyword>
|
||||
<RootNamespace>sdl_gpu_static</RootNamespace>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
<AppContainerApplication>true</AppContainerApplication>
|
||||
<ApplicationType>Windows Store</ApplicationType>
|
||||
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.14393.0</WindowsTargetPlatformMinVersion>
|
||||
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\sdl-gpu\src;..\..\..\3rd-party\sdl-gpu\src\externals\glew;..\..\..\3rd-party\sdl-gpu\src\externals\glew\GL;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image_write;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>SDL_GPU_DISABLE_GLES_1;SDL_GPU_DISABLE_GLES_3;SDL_GPU_DISABLE_OPENGL;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\sdl-gpu\src;..\..\..\3rd-party\sdl-gpu\src\externals\glew;..\..\..\3rd-party\sdl-gpu\src\externals\glew\GL;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image_write;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>SDL_GPU_DISABLE_GLES_1;SDL_GPU_DISABLE_GLES_3;SDL_GPU_DISABLE_OPENGL;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\sdl-gpu\src;..\..\..\3rd-party\sdl-gpu\src\externals\glew;..\..\..\3rd-party\sdl-gpu\src\externals\glew\GL;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image_write;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>SDL_GPU_DISABLE_GLES_1;SDL_GPU_DISABLE_GLES_3;SDL_GPU_DISABLE_OPENGL;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\sdl-gpu\src;..\..\..\3rd-party\sdl-gpu\src\externals\glew;..\..\..\3rd-party\sdl-gpu\src\externals\glew\GL;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image_write;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>SDL_GPU_DISABLE_GLES_1;SDL_GPU_DISABLE_GLES_3;SDL_GPU_DISABLE_OPENGL;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\sdl-gpu\src;..\..\..\3rd-party\sdl-gpu\src\externals\glew;..\..\..\3rd-party\sdl-gpu\src\externals\glew\GL;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image_write;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>SDL_GPU_DISABLE_GLES_1;SDL_GPU_DISABLE_GLES_3;SDL_GPU_DISABLE_OPENGL;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\sdl-gpu\src;..\..\..\3rd-party\sdl-gpu\src\externals\glew;..\..\..\3rd-party\sdl-gpu\src\externals\glew\GL;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image;..\..\..\3rd-party\sdl-gpu\src\externals\stb_image_write;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>SDL_GPU_DISABLE_GLES_1;SDL_GPU_DISABLE_GLES_3;SDL_GPU_DISABLE_OPENGL;GL_GLEXT_PROTOTYPES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\tic\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets" Condition="Exists('..\tic\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.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('..\tic\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\tic\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{c3550c01-2588-4878-8d79-ead29ff8053e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\renderer_GLES_2.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\SDL_gpu.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\SDL_gpu_renderer.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\SDL_gpu_matrix.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\externals\stb_image\stb_image.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\3rd-party\sdl-gpu\src\externals\stb_image_write\stb_image_write.c">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ANGLE.WindowsStore" version="2.1.13" targetFramework="native" />
|
||||
</packages>
|
|
@ -19,6 +19,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wren", "..\wren\wren.vcxpro
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "studio", "..\studio\studio.vcxproj", "{6A22403A-6CF5-49F2-A012-EC04C9496306}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdl-gpu-static", "..\sdl-gpu-static\sdl-gpu-static.vcxproj", "{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
|
@ -131,6 +133,18 @@ Global
|
|||
{6A22403A-6CF5-49F2-A012-EC04C9496306}.Release|x64.Build.0 = Release|x64
|
||||
{6A22403A-6CF5-49F2-A012-EC04C9496306}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6A22403A-6CF5-49F2-A012-EC04C9496306}.Release|x86.Build.0 = Release|Win32
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Debug|x64.Build.0 = Debug|x64
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Debug|x86.Build.0 = Debug|Win32
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Release|ARM.Build.0 = Release|ARM
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Release|x64.ActiveCfg = Release|x64
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Release|x64.Build.0 = Release|x64
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Release|x86.ActiveCfg = Release|Win32
|
||||
{361DFDDB-F86E-4C2C-ABEE-03ACF4B8AC33}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<BufferSecurityCheck>
|
||||
</BufferSecurityCheck>
|
||||
<PreprocessorDefinitions>_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;LUA_COMPAT_5_2;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -125,7 +125,7 @@
|
|||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<BufferSecurityCheck>
|
||||
</BufferSecurityCheck>
|
||||
<PreprocessorDefinitions>_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;LUA_COMPAT_5_2;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -141,7 +141,7 @@
|
|||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<BufferSecurityCheck>
|
||||
</BufferSecurityCheck>
|
||||
<PreprocessorDefinitions>_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;LUA_COMPAT_5_2;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -157,7 +157,7 @@
|
|||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<BufferSecurityCheck>
|
||||
</BufferSecurityCheck>
|
||||
<PreprocessorDefinitions>_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;LUA_COMPAT_5_2;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -173,7 +173,7 @@
|
|||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<BufferSecurityCheck>
|
||||
</BufferSecurityCheck>
|
||||
<PreprocessorDefinitions>_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;LUA_COMPAT_5_2;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -189,7 +189,7 @@
|
|||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\sdl-gpu\include;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2_net-2.0.1;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<BufferSecurityCheck>
|
||||
</BufferSecurityCheck>
|
||||
<PreprocessorDefinitions>_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;LUA_COMPAT_5_2;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -203,6 +203,7 @@
|
|||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
<None Include="packages.config" />
|
||||
<None Include="tic_StoreKey.pfx" />
|
||||
<None Include="tic_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
|
@ -219,6 +220,9 @@
|
|||
<ProjectReference Include="..\..\..\3rd-party\SDL2-2.0.7\VisualC-WinRT\UWP_VS2015\SDL-UWP.vcxproj">
|
||||
<Project>{89e9b32e-a86a-47c3-a948-d2b1622925ce}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\sdl-gpu-static\sdl-gpu-static.vcxproj">
|
||||
<Project>{361dfddb-f86e-4c2c-abee-03acf4b8ac33}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\studio\studio.vcxproj">
|
||||
<Project>{6a22403a-6cf5-49f2-a012-ec04c9496306}</Project>
|
||||
</ProjectReference>
|
||||
|
@ -255,5 +259,12 @@
|
|||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets" Condition="Exists('packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.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\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -45,6 +45,7 @@
|
|||
<None Include="tic_TemporaryKey.pfx" />
|
||||
<None Include="Package.StoreAssociation.xml" />
|
||||
<None Include="tic_StoreKey.pfx" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\src\ext\file_dialog.cpp">
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<DebuggerMachineName>XboxOne</DebuggerMachineName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<DebuggerFlavor>UWPRemoteDebugger</DebuggerFlavor>
|
||||
<DebuggerFlavor>WindowsDeviceDebugger</DebuggerFlavor>
|
||||
<DebuggerMachineName>XboxOne</DebuggerMachineName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;STUDIO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>TIC80_PRO;WIN32;_DEBUG;_WINDOWS;_USRDLL;STUDIO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\wren-0.1.0\src\include</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
|
@ -198,7 +198,7 @@
|
|||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;STUDIO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>TIC80_PRO;_DEBUG;_WINDOWS;_USRDLL;STUDIO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\wren-0.1.0\src\include</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
|
@ -234,7 +234,7 @@
|
|||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;STUDIO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>TIC80_PRO;WIN32;NDEBUG;_WINDOWS;_USRDLL;STUDIO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\wren-0.1.0\src\include</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
|
@ -272,7 +272,7 @@
|
|||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;STUDIO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>TIC80_PRO;NDEBUG;_WINDOWS;_USRDLL;STUDIO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\include;..\..\..\include;..\..\..\3rd-party\lua-5.3.1\src;..\..\..\3rd-party\giflib-5.1.4\lib;..\..\..\3rd-party\zlib-1.2.8;..\..\..\3rd-party\SDL2-2.0.7\include;..\..\..\3rd-party\wren-0.1.0\src\include</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
|
||||
in vec4 color;
|
||||
in vec2 texCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
fragColor = texture2D(tex, texCoord) * color;
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#define distortion 0.08
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
vec2 radialDistortion(vec2 coord) {
|
||||
vec2 cc = coord - vec2(0.5);
|
||||
float dist = dot(cc, cc) * distortion;
|
||||
return coord + cc * (1.0 - dist) * dist;
|
||||
}
|
||||
|
||||
void main(void) {
|
||||
vec4 rgba = texture2D(tex, radialDistortion(texCoord));
|
||||
|
||||
vec4 intensity = fract(gl_FragCoord.y * (0.5 * 4.0 / 3.0)) > 0.5
|
||||
? vec4(0)
|
||||
: smoothstep(0.2, 0.8, rgba) + normalize(rgba);
|
||||
|
||||
fragColor = intensity * -0.25 + rgba * 1.1;
|
||||
|
||||
}
|
|
@ -1,126 +0,0 @@
|
|||
in vec2 texCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
uniform sampler2D tex;
|
||||
uniform float trg_w;
|
||||
uniform float trg_h;
|
||||
|
||||
// Emulated input resolution.
|
||||
vec2 res=vec2(256.0,144.0);
|
||||
|
||||
vec2 trg=vec2(trg_w, trg_h);
|
||||
|
||||
// Hardness of scanline.
|
||||
// -8.0 = soft
|
||||
// -16.0 = medium
|
||||
float hardScan=-8.0;
|
||||
|
||||
// Hardness of pixels in scanline.
|
||||
// -2.0 = soft
|
||||
// -4.0 = hard
|
||||
float hardPix=-3.0;
|
||||
|
||||
// Display warp.
|
||||
// 0.0 = none
|
||||
// 1.0/8.0 = extreme
|
||||
vec2 warp=vec2(1.0/32.0,1.0/24.0);
|
||||
|
||||
// Amount of shadow mask.
|
||||
float maskDark=0.5;
|
||||
float maskLight=1.5;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// sRGB to Linear.
|
||||
// Assuing using sRGB typed textures this should not be needed.
|
||||
float ToLinear1(float c){return(c<=0.04045)?c/12.92:pow((c+0.055)/1.055,2.4);}
|
||||
vec3 ToLinear(vec3 c){return vec3(ToLinear1(c.r),ToLinear1(c.g),ToLinear1(c.b));}
|
||||
|
||||
// Linear to sRGB.
|
||||
// Assuing using sRGB typed textures this should not be needed.
|
||||
float ToSrgb1(float c){return(c<0.0031308?c*12.92:1.055*pow(c,0.41666)-0.055);}
|
||||
vec3 ToSrgb(vec3 c){return vec3(ToSrgb1(c.r),ToSrgb1(c.g),ToSrgb1(c.b));}
|
||||
|
||||
// Nearest emulated sample given floating point position and texel offset.
|
||||
// Also zero's off screen.
|
||||
vec3 Fetch(vec2 pos,vec2 off){
|
||||
pos=(floor(pos*res+off)+vec2(0.5,0.5))/res;
|
||||
return ToLinear(1.2 * texture2D(tex,pos.xy,-16.0).rgb);} //vec2???
|
||||
|
||||
// Distance in emulated pixels to nearest texel.
|
||||
vec2 Dist(vec2 pos){pos=pos*res;return -((pos-floor(pos))-vec2(0.5));}
|
||||
|
||||
// 1D Gaussian.
|
||||
float Gaus(float pos,float scale){return exp2(scale*pos*pos);}
|
||||
|
||||
// 3-tap Gaussian filter along horz line.
|
||||
vec3 Horz3(vec2 pos,float off){
|
||||
vec3 b=Fetch(pos,vec2(-1.0,off));
|
||||
vec3 c=Fetch(pos,vec2( 0.0,off));
|
||||
vec3 d=Fetch(pos,vec2( 1.0,off));
|
||||
float dst=Dist(pos).x;
|
||||
// Convert distance to weight.
|
||||
float scale=hardPix;
|
||||
float wb=Gaus(dst-1.0,scale);
|
||||
float wc=Gaus(dst+0.0,scale);
|
||||
float wd=Gaus(dst+1.0,scale);
|
||||
// Return filtered sample.
|
||||
return (b*wb+c*wc+d*wd)/(wb+wc+wd);}
|
||||
|
||||
// 5-tap Gaussian filter along horz line.
|
||||
vec3 Horz5(vec2 pos,float off){
|
||||
vec3 a=Fetch(pos,vec2(-2.0,off));
|
||||
vec3 b=Fetch(pos,vec2(-1.0,off));
|
||||
vec3 c=Fetch(pos,vec2( 0.0,off));
|
||||
vec3 d=Fetch(pos,vec2( 1.0,off));
|
||||
vec3 e=Fetch(pos,vec2( 2.0,off));
|
||||
float dst=Dist(pos).x;
|
||||
// Convert distance to weight.
|
||||
float scale=hardPix;
|
||||
float wa=Gaus(dst-2.0,scale);
|
||||
float wb=Gaus(dst-1.0,scale);
|
||||
float wc=Gaus(dst+0.0,scale);
|
||||
float wd=Gaus(dst+1.0,scale);
|
||||
float we=Gaus(dst+2.0,scale);
|
||||
// Return filtered sample.
|
||||
return (a*wa+b*wb+c*wc+d*wd+e*we)/(wa+wb+wc+wd+we);}
|
||||
|
||||
// Return scanline weight.
|
||||
float Scan(vec2 pos,float off){
|
||||
float dst=Dist(pos).y;
|
||||
return Gaus(dst+off,hardScan);}
|
||||
|
||||
// Allow nearest three lines to effect pixel.
|
||||
vec3 Tri(vec2 pos){
|
||||
vec3 a=Horz3(pos,-1.0);
|
||||
vec3 b=Horz5(pos, 0.0);
|
||||
vec3 c=Horz3(pos, 1.0);
|
||||
float wa=Scan(pos,-1.0);
|
||||
float wb=Scan(pos, 0.0);
|
||||
float wc=Scan(pos, 1.0);
|
||||
return a*wa+b*wb+c*wc;}
|
||||
|
||||
// Distortion of scanlines, and end of screen alpha.
|
||||
vec2 Warp(vec2 pos){
|
||||
pos=pos*2.0-1.0;
|
||||
pos*=vec2(1.0+(pos.y*pos.y)*warp.x,1.0+(pos.x*pos.x)*warp.y);
|
||||
return pos*0.5+0.5;}
|
||||
|
||||
// Shadow mask.
|
||||
vec3 Mask(vec2 pos){
|
||||
pos.x+=pos.y*3.0;
|
||||
vec3 mask=vec3(maskDark,maskDark,maskDark);
|
||||
pos.x=fract(pos.x/6.0);
|
||||
if(pos.x<0.333)mask.r=maskLight;
|
||||
else if(pos.x<0.666)mask.g=maskLight;
|
||||
else mask.b=maskLight;
|
||||
return mask;}
|
||||
|
||||
void main()
|
||||
{
|
||||
// maskDark=maskLight;
|
||||
vec2 pos=Warp(gl_FragCoord.xy/trg);
|
||||
fragColor.rgb=Tri(vec2(pos.s, 1.0 - pos.t))*Mask(gl_FragCoord.xy);
|
||||
fragColor.a=1.0;
|
||||
fragColor = vec4(ToSrgb(fragColor.rgb), fragColor.a);
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
in vec2 texCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 rgba = texture2D(tex, texCoord);
|
||||
|
||||
vec4 intensity = fract(gl_FragCoord.y * (0.5 * 4.0 / 3.0)) > 0.5
|
||||
? vec4(0)
|
||||
: smoothstep(0.2, 0.8, rgba) + normalize(rgba);
|
||||
|
||||
fragColor = intensity * -0.25 + rgba * 1.1;
|
||||
}
|
|
@ -1,14 +1,19 @@
|
|||
attribute vec3 gpu_Vertex;
|
||||
CODE(
|
||||
|
||||
precision highp float;
|
||||
precision mediump int;
|
||||
|
||||
attribute vec2 gpu_Vertex;
|
||||
attribute vec2 gpu_TexCoord;
|
||||
attribute vec4 gpu_Color;
|
||||
attribute mediump vec4 gpu_Color;
|
||||
uniform mat4 gpu_ModelViewProjectionMatrix;
|
||||
|
||||
varying vec4 color;
|
||||
varying mediump vec4 color;
|
||||
varying vec2 texCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
color = gpu_Color;
|
||||
texCoord = vec2(gpu_TexCoord);
|
||||
gl_Position = gpu_ModelViewProjectionMatrix * vec4(gpu_Vertex, 1.0);
|
||||
}
|
||||
gl_Position = gpu_ModelViewProjectionMatrix * vec4(gpu_Vertex, 0.0, 1.0);
|
||||
})
|
|
@ -0,0 +1,127 @@
|
|||
CODE(
|
||||
|
||||
precision highp float;
|
||||
|
||||
varying vec2 texCoord;
|
||||
uniform sampler2D source;
|
||||
uniform float trg_w;
|
||||
uniform float trg_h;
|
||||
|
||||
// Emulated input resolution.
|
||||
vec2 res=vec2(256.0,144.0);
|
||||
vec2 trg=vec2(trg_w, trg_h);
|
||||
|
||||
// Hardness of scanline.
|
||||
// -8.0 = soft
|
||||
// -16.0 = medium
|
||||
float hardScan=-8.0;
|
||||
|
||||
// Hardness of pixels in scanline.
|
||||
// -2.0 = soft
|
||||
// -4.0 = hard
|
||||
float hardPix=-3.0;
|
||||
|
||||
// Display warp.
|
||||
// 0.0 = none
|
||||
// 1.0/8.0 = extreme
|
||||
vec2 warp=vec2(1.0/32.0,1.0/24.0);
|
||||
|
||||
// Amount of shadow mask.
|
||||
float maskDark=0.5;
|
||||
float maskLight=1.5;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// sRGB to Linear.
|
||||
// Assuing using sRGB typed textures this should not be needed.
|
||||
float ToLinear1(float c){return(c<=0.04045)?c/12.92:pow((c+0.055)/1.055,2.4);}
|
||||
vec3 ToLinear(vec3 c){return vec3(ToLinear1(c.r),ToLinear1(c.g),ToLinear1(c.b));}
|
||||
|
||||
// Linear to sRGB.
|
||||
// Assuing using sRGB typed textures this should not be needed.
|
||||
float ToSrgb1(float c){return(c<0.0031308?c*12.92:1.055*pow(c,0.41666)-0.055);}
|
||||
vec3 ToSrgb(vec3 c){return vec3(ToSrgb1(c.r),ToSrgb1(c.g),ToSrgb1(c.b));}
|
||||
|
||||
// Nearest emulated sample given floating point position and texel offset.
|
||||
// Also zero's off screen.
|
||||
vec3 Fetch(vec2 pos,vec2 off){
|
||||
pos=(floor(pos*res+off)+vec2(0.5,0.5))/res;
|
||||
return ToLinear(1.2 * texture2D(source,pos.xy,-16.0).rgb);}
|
||||
|
||||
// Distance in emulated pixels to nearest texel.
|
||||
vec2 Dist(vec2 pos){pos=pos*res;return -((pos-floor(pos))-vec2(0.5));}
|
||||
|
||||
// 1D Gaussian.
|
||||
float Gaus(float pos,float scale){return exp2(scale*pos*pos);}
|
||||
|
||||
// 3-tap Gaussian filter along horz line.
|
||||
vec3 Horz3(vec2 pos,float off){
|
||||
vec3 b=Fetch(pos,vec2(-1.0,off));
|
||||
vec3 c=Fetch(pos,vec2( 0.0,off));
|
||||
vec3 d=Fetch(pos,vec2( 1.0,off));
|
||||
float dst=Dist(pos).x;
|
||||
// Convert distance to weight.
|
||||
float scale=hardPix;
|
||||
float wb=Gaus(dst-1.0,scale);
|
||||
float wc=Gaus(dst+0.0,scale);
|
||||
float wd=Gaus(dst+1.0,scale);
|
||||
// Return filtered sample.
|
||||
return (b*wb+c*wc+d*wd)/(wb+wc+wd);}
|
||||
|
||||
// 5-tap Gaussian filter along horz line.
|
||||
vec3 Horz5(vec2 pos,float off){
|
||||
vec3 a=Fetch(pos,vec2(-2.0,off));
|
||||
vec3 b=Fetch(pos,vec2(-1.0,off));
|
||||
vec3 c=Fetch(pos,vec2( 0.0,off));
|
||||
vec3 d=Fetch(pos,vec2( 1.0,off));
|
||||
vec3 e=Fetch(pos,vec2( 2.0,off));
|
||||
float dst=Dist(pos).x;
|
||||
// Convert distance to weight.
|
||||
float scale=hardPix;
|
||||
float wa=Gaus(dst-2.0,scale);
|
||||
float wb=Gaus(dst-1.0,scale);
|
||||
float wc=Gaus(dst+0.0,scale);
|
||||
float wd=Gaus(dst+1.0,scale);
|
||||
float we=Gaus(dst+2.0,scale);
|
||||
// Return filtered sample.
|
||||
return (a*wa+b*wb+c*wc+d*wd+e*we)/(wa+wb+wc+wd+we);}
|
||||
|
||||
// Return scanline weight.
|
||||
float Scan(vec2 pos,float off){
|
||||
float dst=Dist(pos).y;
|
||||
return Gaus(dst+off,hardScan);}
|
||||
|
||||
// Allow nearest three lines to effect pixel.
|
||||
vec3 Tri(vec2 pos){
|
||||
vec3 a=Horz3(pos,-1.0);
|
||||
vec3 b=Horz5(pos, 0.0);
|
||||
vec3 c=Horz3(pos, 1.0);
|
||||
float wa=Scan(pos,-1.0);
|
||||
float wb=Scan(pos, 0.0);
|
||||
float wc=Scan(pos, 1.0);
|
||||
return a*wa+b*wb+c*wc;}
|
||||
|
||||
// Distortion of scanlines, and end of screen alpha.
|
||||
vec2 Warp(vec2 pos){
|
||||
pos=pos*2.0-1.0;
|
||||
pos*=vec2(1.0+(pos.y*pos.y)*warp.x,1.0+(pos.x*pos.x)*warp.y);
|
||||
return pos*0.5+0.5;}
|
||||
|
||||
// Shadow mask.
|
||||
vec3 Mask(vec2 pos){
|
||||
pos.x+=pos.y*3.0;
|
||||
vec3 mask=vec3(maskDark,maskDark,maskDark);
|
||||
pos.x=fract(pos.x/6.0);
|
||||
if(pos.x<0.333)mask.r=maskLight;
|
||||
else if(pos.x<0.666)mask.g=maskLight;
|
||||
else mask.b=maskLight;
|
||||
return mask;}
|
||||
|
||||
void main() {
|
||||
vec2 pos = gl_FragCoord.xy/trg.xy;
|
||||
hardScan=-12.0;
|
||||
// maskDark=maskLight;
|
||||
pos=Warp(gl_FragCoord.xy/trg.xy);
|
||||
gl_FragColor.rgb=Tri(vec2(pos.s, 1.0 - pos.t))*Mask(gl_FragCoord.xy);
|
||||
gl_FragColor = vec4(ToSrgb(gl_FragColor.rgb), 1.0);
|
||||
})
|
|
@ -1006,9 +1006,10 @@ static void copyFromClipboard(Map* map)
|
|||
static void processKeyboard(Map* map)
|
||||
{
|
||||
tic_mem* tic = map->tic;
|
||||
map->sheet.show = false;
|
||||
|
||||
if(tic->ram.input.keyboard.data == 0) return;
|
||||
|
||||
map->sheet.show = false;
|
||||
|
||||
bool shift = tic->api.key(tic, tic_key_shift);
|
||||
bool ctrl = tic->api.key(tic, tic_key_ctrl);
|
||||
|
|
105
src/system.c
105
src/system.c
|
@ -14,7 +14,7 @@
|
|||
#endif
|
||||
|
||||
#define STUDIO_UI_SCALE 4
|
||||
#define STUDIO_PIXEL_FORMAT SDL_PIXELFORMAT_ARGB8888
|
||||
#define STUDIO_PIXEL_FORMAT SDL_PIXELFORMAT_ABGR8888
|
||||
#define TEXTURE_SIZE (TIC80_FULLWIDTH)
|
||||
#define OFFSET_LEFT ((TIC80_FULLWIDTH-TIC80_WIDTH)/2)
|
||||
#define OFFSET_TOP ((TIC80_FULLHEIGHT-TIC80_HEIGHT)/2)
|
||||
|
@ -1060,95 +1060,47 @@ static void emstick()
|
|||
|
||||
#endif
|
||||
|
||||
Uint32 load_shader(GPU_ShaderEnum shader_type, const char* filename)
|
||||
{
|
||||
SDL_RWops* rwops;
|
||||
Uint32 shader;
|
||||
char* source;
|
||||
int header_size, file_size;
|
||||
const char* header = "";
|
||||
GPU_Renderer* renderer = GPU_GetCurrentRenderer();
|
||||
|
||||
// Open file
|
||||
rwops = SDL_RWFromFile(filename, "rb");
|
||||
if(rwops == NULL)
|
||||
{
|
||||
GPU_PushErrorCode("load_shader", GPU_ERROR_FILE_NOT_FOUND, "Shader file \"%s\" not found", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get file size
|
||||
file_size = SDL_RWseek(rwops, 0, SEEK_END);
|
||||
SDL_RWseek(rwops, 0, SEEK_SET);
|
||||
|
||||
// Get size from header
|
||||
if(renderer->shader_language == GPU_LANGUAGE_GLSL)
|
||||
{
|
||||
if(renderer->max_shader_version >= 120)
|
||||
header = "#version 120\n";
|
||||
else
|
||||
header = "#version 110\n"; // Maybe this is good enough?
|
||||
}
|
||||
else if(renderer->shader_language == GPU_LANGUAGE_GLSLES)
|
||||
header = "#version 100\nprecision mediump int;\nprecision mediump float;\n";
|
||||
|
||||
header_size = strlen(header);
|
||||
|
||||
// Allocate source buffer
|
||||
source = (char*)malloc(sizeof(char)*(header_size + file_size + 1));
|
||||
|
||||
// Prepend header
|
||||
strcpy(source, header);
|
||||
|
||||
// Read in source code
|
||||
SDL_RWread(rwops, source + strlen(source), 1, file_size);
|
||||
source[header_size + file_size] = '\0';
|
||||
|
||||
// Compile the shader
|
||||
shader = GPU_CompileShader(shader_type, source);
|
||||
|
||||
// Clean up
|
||||
free(source);
|
||||
SDL_RWclose(rwops);
|
||||
|
||||
return shader;
|
||||
}
|
||||
#define CODE(...) #__VA_ARGS__
|
||||
|
||||
GPU_ShaderBlock load_shader_program(Uint32* p, const char* vertex_shader_file, const char* fragment_shader_file)
|
||||
u32 load_shader_program()
|
||||
{
|
||||
Uint32 v, f;
|
||||
v = load_shader(GPU_VERTEX_SHADER, vertex_shader_file);
|
||||
|
||||
static const char* VertexShader =
|
||||
#include "ext/shader/common.vert"
|
||||
;
|
||||
|
||||
v = GPU_CompileShader(GPU_VERTEX_SHADER, VertexShader);
|
||||
|
||||
if(!v)
|
||||
GPU_LogError("Failed to load vertex shader (%s): %s\n", vertex_shader_file, GPU_GetShaderMessage());
|
||||
|
||||
f = load_shader(GPU_PIXEL_SHADER, fragment_shader_file);
|
||||
GPU_LogError("Failed to load vertex shader: %s\n", GPU_GetShaderMessage());
|
||||
|
||||
static const char* PixelShader =
|
||||
#include "ext/shader/crt-lottes.frag"
|
||||
;
|
||||
|
||||
f = GPU_CompileShader(GPU_PIXEL_SHADER, PixelShader);
|
||||
|
||||
if(!f)
|
||||
GPU_LogError("Failed to load fragment shader (%s): %s\n", fragment_shader_file, GPU_GetShaderMessage());
|
||||
GPU_LogError("Failed to load fragment shader: %s\n", GPU_GetShaderMessage());
|
||||
|
||||
*p = GPU_LinkShaders(v, f);
|
||||
u32 p = GPU_LinkShaders(v, f);
|
||||
|
||||
if(!*p)
|
||||
if(!p)
|
||||
{
|
||||
GPU_ShaderBlock b = {-1, -1, -1, -1};
|
||||
GPU_LogError("Failed to link shader program (%s + %s): %s\n", vertex_shader_file, fragment_shader_file, GPU_GetShaderMessage());
|
||||
return b;
|
||||
GPU_LogError("Failed to link shader program: %s\n", GPU_GetShaderMessage());
|
||||
return p;
|
||||
}
|
||||
|
||||
{
|
||||
GPU_ShaderBlock block = GPU_LoadShaderBlock(*p, "gpu_Vertex", "gpu_TexCoord", "gpu_Color", "gpu_ModelViewProjectionMatrix");
|
||||
GPU_ActivateShaderProgram(*p, &block);
|
||||
GPU_ShaderBlock block = GPU_LoadShaderBlock(p, "gpu_Vertex", "gpu_TexCoord", "gpu_Color", "gpu_ModelViewProjectionMatrix");
|
||||
GPU_ActivateShaderProgram(p, &block);
|
||||
|
||||
return block;
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
void free_shader(Uint32 p)
|
||||
{
|
||||
GPU_FreeShaderProgram(p);
|
||||
}
|
||||
|
||||
#include <math.h>
|
||||
|
||||
static s32 start(s32 argc, char **argv, const char* folder)
|
||||
|
@ -1176,12 +1128,11 @@ static s32 start(s32 argc, char **argv, const char* folder)
|
|||
|
||||
GPU_Target* screen = GPU_Init(Width, Height, GPU_INIT_DISABLE_VSYNC);
|
||||
|
||||
GPU_Image* texture = GPU_CreateImage(TIC80_FULLWIDTH, TIC80_FULLHEIGHT, GPU_FORMAT_BGRA);
|
||||
GPU_Image* texture = GPU_CreateImage(TIC80_FULLWIDTH, TIC80_FULLHEIGHT, GPU_FORMAT_RGBA);
|
||||
GPU_SetAnchor(texture, 0, 0);
|
||||
GPU_SetImageFilter(texture, GPU_FILTER_NEAREST);
|
||||
|
||||
u32 crt_shader = 0;
|
||||
load_shader_program(&crt_shader, "data/shaders/common.vert", "data/shaders/crt-lottes.frag");
|
||||
u32 crt_shader = load_shader_program(&crt_shader);
|
||||
|
||||
{
|
||||
u64 nextTick = SDL_GetPerformanceCounter();
|
||||
|
@ -1240,10 +1191,8 @@ static s32 start(s32 argc, char **argv, const char* folder)
|
|||
|
||||
SDL_CloseAudioDevice(platform.audio.device);
|
||||
|
||||
free_shader(crt_shader);
|
||||
|
||||
GPU_FreeShaderProgram(crt_shader);
|
||||
GPU_FreeImage(texture);
|
||||
|
||||
GPU_Quit();
|
||||
|
||||
return 0;
|
||||
|
|
51
src/tic.c
51
src/tic.c
|
@ -27,6 +27,7 @@
|
|||
#include <math.h>
|
||||
#include <ctype.h>
|
||||
#include <stddef.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "ticapi.h"
|
||||
#include "tools.h"
|
||||
|
@ -823,10 +824,8 @@ static struct
|
|||
{
|
||||
s16 Left[TIC80_HEIGHT];
|
||||
s16 Right[TIC80_HEIGHT];
|
||||
float ULeft[TIC80_HEIGHT];
|
||||
float VLeft[TIC80_HEIGHT];
|
||||
float URight[TIC80_HEIGHT];
|
||||
float VRight[TIC80_HEIGHT];
|
||||
s32 ULeft[TIC80_HEIGHT];
|
||||
s32 VLeft[TIC80_HEIGHT];
|
||||
} SidesBuffer;
|
||||
|
||||
static void initSidesBuffer()
|
||||
|
@ -852,14 +851,12 @@ static void setSideTexPixel(s32 x, s32 y, float u, float v)
|
|||
if (x < SidesBuffer.Left[yy])
|
||||
{
|
||||
SidesBuffer.Left[yy] = x;
|
||||
SidesBuffer.ULeft[yy] = u;
|
||||
SidesBuffer.VLeft[yy] = v;
|
||||
SidesBuffer.ULeft[yy] = u*65536.0f;
|
||||
SidesBuffer.VLeft[yy] = v*65536.0f;
|
||||
}
|
||||
if (x > SidesBuffer.Right[yy])
|
||||
{
|
||||
SidesBuffer.Right[yy] = x;
|
||||
SidesBuffer.URight[yy] = u;
|
||||
SidesBuffer.VRight[yy] = v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1015,22 +1012,37 @@ static void api_textri(tic_mem* memory, float x1, float y1, float x2, float y2,
|
|||
V0.x = (float)x1; V0.y = (float)y1; V0.u = (float)u1; V0.v = (float)v1;
|
||||
V1.x = (float)x2; V1.y = (float)y2; V1.u = (float)u2; V1.v = (float)v2;
|
||||
V2.x = (float)x3; V2.y = (float)y3; V2.u = (float)u3; V2.v = (float)v3;
|
||||
|
||||
// calculate the slope of the surface
|
||||
// use floats here
|
||||
double denom = (V0.x - V2.x) * (V1.y - V2.y) - (V1.x - V2.x) * (V0.y - V2.y);
|
||||
if (denom == 0.0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
double id = 1.0 / denom;
|
||||
float dudx, dvdx;
|
||||
// this is the UV slope across the surface
|
||||
dudx = ((V0.u - V2.u) * (V1.y - V2.y) - (V1.u - V2.u) * (V0.y - V2.y)) * id;
|
||||
dvdx = ((V0.v - V2.v) * (V1.y - V2.y) - (V1.v - V2.v) * (V0.y - V2.y)) * id;
|
||||
// convert to fixed
|
||||
s32 dudxs = dudx * 65536.0f;
|
||||
s32 dvdxs = dvdx * 65536.0f;
|
||||
|
||||
initSidesBuffer();
|
||||
|
||||
ticTexLine(memory, &V0, &V1);
|
||||
ticTexLine(memory, &V1, &V2);
|
||||
ticTexLine(memory, &V2, &V0);
|
||||
|
||||
|
||||
{
|
||||
for (s32 y = 0; y < TIC80_HEIGHT; y++)
|
||||
{
|
||||
float width = SidesBuffer.Right[y] - SidesBuffer.Left[y];
|
||||
if (width > 0)
|
||||
{
|
||||
float du = (SidesBuffer.URight[y] - SidesBuffer.ULeft[y]) / width;
|
||||
float dv = (SidesBuffer.VRight[y] - SidesBuffer.VLeft[y]) / width;
|
||||
float u = SidesBuffer.ULeft[y];
|
||||
float v = SidesBuffer.VLeft[y];
|
||||
s32 u = SidesBuffer.ULeft[y];
|
||||
s32 v = SidesBuffer.VLeft[y];
|
||||
|
||||
for (s32 x = (s32)SidesBuffer.Left[y]; x <= (s32)SidesBuffer.Right[y]; ++x)
|
||||
{
|
||||
|
@ -1040,8 +1052,8 @@ static void api_textri(tic_mem* memory, float x1, float y1, float x2, float y2,
|
|||
{
|
||||
enum {MapWidth = TIC_MAP_WIDTH * TIC_SPRITESIZE, MapHeight = TIC_MAP_HEIGHT * TIC_SPRITESIZE};
|
||||
|
||||
s32 iu = (s32)u % MapWidth;
|
||||
s32 iv = (s32)v % MapHeight;
|
||||
s32 iu = (u >> 16) % MapWidth;
|
||||
s32 iv = (v >> 16) % MapHeight;
|
||||
|
||||
while (iu < 0) iu += MapWidth;
|
||||
while (iv < 0) iv += MapHeight;
|
||||
|
@ -1056,16 +1068,16 @@ static void api_textri(tic_mem* memory, float x1, float y1, float x2, float y2,
|
|||
{
|
||||
enum{SheetWidth = TIC_SPRITESHEET_SIZE, SheetHeight = TIC_SPRITESHEET_SIZE * TIC_SPRITE_BANKS};
|
||||
|
||||
s32 iu = (s32)(u) & (SheetWidth - 1);
|
||||
s32 iv = (s32)(v) & (SheetHeight - 1);
|
||||
s32 iu = (u>>16) & (SheetWidth - 1);
|
||||
s32 iv = (v>>16) & (SheetHeight - 1);
|
||||
const u8 *buffer = &ptr[((iu >> 3) + ((iv >> 3) << 4)) << 5];
|
||||
u8 color = tic_tool_peek4(buffer, (iu & 7) + ((iv & 7) << 3));
|
||||
if (color != chroma)
|
||||
setPixel(machine, x, y, color);
|
||||
}
|
||||
}
|
||||
u += du;
|
||||
v += dv;
|
||||
u += dudxs;
|
||||
v += dvdxs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1073,6 +1085,7 @@ static void api_textri(tic_mem* memory, float x1, float y1, float x2, float y2,
|
|||
}
|
||||
|
||||
|
||||
|
||||
static void api_sprite(tic_mem* memory, const tic_tiles* src, s32 index, s32 x, s32 y, u8* colors, s32 count)
|
||||
{
|
||||
drawSprite(memory, src, index, x, y, colors, count, 1, tic_no_flip, tic_no_rotate);
|
||||
|
|
24
src/tools.c
24
src/tools.c
|
@ -88,20 +88,20 @@ u32 tic_tool_find_closest_color(const tic_rgb* palette, const tic_rgb* color)
|
|||
|
||||
u32* tic_palette_blit(const tic_palette* srcpal)
|
||||
{
|
||||
static u32 pal[TIC_PALETTE_SIZE] = {0};
|
||||
|
||||
const u8* src = srcpal->data;
|
||||
|
||||
memset(pal, 0xff, sizeof pal);
|
||||
static u32 pal[TIC_PALETTE_SIZE];
|
||||
|
||||
const tic_rgb* src = srcpal->colors;
|
||||
const tic_rgb* end = src + TIC_PALETTE_SIZE;
|
||||
u8* dst = (u8*)pal;
|
||||
const u8* end = src + sizeof(tic_palette);
|
||||
|
||||
enum{RGB = sizeof(tic_rgb)};
|
||||
|
||||
for(; src != end; dst++, src+=RGB)
|
||||
for(s32 j = 0; j < RGB; j++)
|
||||
*dst++ = *(src+(RGB-1)-j);
|
||||
while(src != end)
|
||||
{
|
||||
*dst++ = src->r;
|
||||
*dst++ = src->g;
|
||||
*dst++ = src->b;
|
||||
*dst++ = 0xff;
|
||||
src++;
|
||||
}
|
||||
|
||||
return pal;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue