Added software fallback for YUV overlay code when YUV textures aren't available.
authorSam Lantinga <slouken@libsdl.org>
Mon, 24 Nov 2008 23:25:36 +0000
changeset 27815651642f4a78
parent 2780 cc15254e44b6
child 2782 53689036f265
Added software fallback for YUV overlay code when YUV textures aren't available.
VisualC/tests/testoverlay/testoverlay.dsp
VisualC/tests/testoverlay/testoverlay.vcproj
VisualC/tests/testoverlay2/testoverlay2.dsp
VisualC/tests/testoverlay2/testoverlay2.vcproj
VisualC/tests/tests.dsw
VisualC/tests/tests.sln
src/SDL_compat.c
src/stdlib/SDL_stdlib.c
src/video/SDL_renderer_sw.c
src/video/SDL_yuv_sw.c
src/video/SDL_yuv_sw_c.h
src/video/win32/SDL_gdirender.c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/VisualC/tests/testoverlay/testoverlay.dsp	Mon Nov 24 23:25:36 2008 +0000
     1.3 @@ -0,0 +1,102 @@
     1.4 +# Microsoft Developer Studio Project File - Name="testoverlay" - Package Owner=<4>
     1.5 +# Microsoft Developer Studio Generated Build File, Format Version 5.00
     1.6 +# ** DO NOT EDIT **
     1.7 +
     1.8 +# TARGTYPE "Win32 (x86) Application" 0x0101
     1.9 +
    1.10 +CFG=testoverlay - Win32 Debug
    1.11 +!MESSAGE This is not a valid makefile. To build this project using NMAKE,
    1.12 +!MESSAGE use the Export Makefile command and run
    1.13 +!MESSAGE 
    1.14 +!MESSAGE NMAKE /f "testoverlay.mak".
    1.15 +!MESSAGE 
    1.16 +!MESSAGE You can specify a configuration when running NMAKE
    1.17 +!MESSAGE by defining the macro CFG on the command line. For example:
    1.18 +!MESSAGE 
    1.19 +!MESSAGE NMAKE /f "testoverlay.mak" CFG="testoverlay - Win32 Debug"
    1.20 +!MESSAGE 
    1.21 +!MESSAGE Possible choices for configuration are:
    1.22 +!MESSAGE 
    1.23 +!MESSAGE "testoverlay - Win32 Release" (based on "Win32 (x86) Application")
    1.24 +!MESSAGE "testoverlay - Win32 Debug" (based on "Win32 (x86) Application")
    1.25 +!MESSAGE 
    1.26 +
    1.27 +# Begin Project
    1.28 +# PROP Scc_ProjName ""
    1.29 +# PROP Scc_LocalPath ""
    1.30 +CPP=cl.exe
    1.31 +MTL=midl.exe
    1.32 +RSC=rc.exe
    1.33 +
    1.34 +!IF  "$(CFG)" == "testoverlay - Win32 Release"
    1.35 +
    1.36 +# PROP BASE Use_MFC 0
    1.37 +# PROP BASE Use_Debug_Libraries 0
    1.38 +# PROP BASE Output_Dir "Release"
    1.39 +# PROP BASE Intermediate_Dir "Release"
    1.40 +# PROP BASE Target_Dir ""
    1.41 +# PROP Use_MFC 0
    1.42 +# PROP Use_Debug_Libraries 0
    1.43 +# PROP Output_Dir "Release"
    1.44 +# PROP Intermediate_Dir "Release"
    1.45 +# PROP Ignore_Export_Lib 0
    1.46 +# PROP Target_Dir ""
    1.47 +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
    1.48 +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
    1.49 +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
    1.50 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
    1.51 +# ADD BASE RSC /l 0x409 /d "NDEBUG"
    1.52 +# ADD RSC /l 0x409 /d "NDEBUG"
    1.53 +BSC32=bscmake.exe
    1.54 +# ADD BASE BSC32 /nologo
    1.55 +# ADD BSC32 /nologo
    1.56 +LINK32=link.exe
    1.57 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
    1.58 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
    1.59 +
    1.60 +!ELSEIF  "$(CFG)" == "testoverlay - Win32 Debug"
    1.61 +
    1.62 +# PROP BASE Use_MFC 0
    1.63 +# PROP BASE Use_Debug_Libraries 1
    1.64 +# PROP BASE Output_Dir "Debug"
    1.65 +# PROP BASE Intermediate_Dir "Debug"
    1.66 +# PROP BASE Target_Dir ""
    1.67 +# PROP Use_MFC 0
    1.68 +# PROP Use_Debug_Libraries 1
    1.69 +# PROP Output_Dir "Debug"
    1.70 +# PROP Intermediate_Dir "Debug"
    1.71 +# PROP Ignore_Export_Lib 0
    1.72 +# PROP Target_Dir ""
    1.73 +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
    1.74 +# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
    1.75 +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
    1.76 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
    1.77 +# ADD BASE RSC /l 0x409 /d "_DEBUG"
    1.78 +# ADD RSC /l 0x409 /d "_DEBUG"
    1.79 +BSC32=bscmake.exe
    1.80 +# ADD BASE BSC32 /nologo
    1.81 +# ADD BSC32 /nologo
    1.82 +LINK32=link.exe
    1.83 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
    1.84 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
    1.85 +
    1.86 +!ENDIF 
    1.87 +
    1.88 +# Begin Target
    1.89 +
    1.90 +# Name "testoverlay - Win32 Release"
    1.91 +# Name "testoverlay - Win32 Debug"
    1.92 +# Begin Source File
    1.93 +
    1.94 +SOURCE=..\..\Sdl\Debug\SDL.lib
    1.95 +# End Source File
    1.96 +# Begin Source File
    1.97 +
    1.98 +SOURCE=..\..\SDLmain\Debug\SDLmain.lib
    1.99 +# End Source File
   1.100 +# Begin Source File
   1.101 +
   1.102 +SOURCE=..\..\..\test\testoverlay.c
   1.103 +# End Source File
   1.104 +# End Target
   1.105 +# End Project
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/VisualC/tests/testoverlay/testoverlay.vcproj	Mon Nov 24 23:25:36 2008 +0000
     2.3 @@ -0,0 +1,217 @@
     2.4 +<?xml version="1.0" encoding="Windows-1252"?>
     2.5 +<VisualStudioProject
     2.6 +	ProjectType="Visual C++"
     2.7 +	Version="8.00"
     2.8 +	Name="testoverlay"
     2.9 +	ProjectGUID="{9E320A14-B443-4DD7-8725-B7020DCFF730}"
    2.10 +	>
    2.11 +	<Platforms>
    2.12 +		<Platform
    2.13 +			Name="Win32"
    2.14 +		/>
    2.15 +	</Platforms>
    2.16 +	<ToolFiles>
    2.17 +	</ToolFiles>
    2.18 +	<Configurations>
    2.19 +		<Configuration
    2.20 +			Name="Release|Win32"
    2.21 +			OutputDirectory=".\Release"
    2.22 +			IntermediateDirectory=".\Release"
    2.23 +			ConfigurationType="1"
    2.24 +			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
    2.25 +			UseOfMFC="0"
    2.26 +			ATLMinimizesCRunTimeLibraryUsage="false"
    2.27 +			>
    2.28 +			<Tool
    2.29 +				Name="VCPreBuildEventTool"
    2.30 +			/>
    2.31 +			<Tool
    2.32 +				Name="VCCustomBuildTool"
    2.33 +			/>
    2.34 +			<Tool
    2.35 +				Name="VCXMLDataGeneratorTool"
    2.36 +			/>
    2.37 +			<Tool
    2.38 +				Name="VCWebServiceProxyGeneratorTool"
    2.39 +			/>
    2.40 +			<Tool
    2.41 +				Name="VCMIDLTool"
    2.42 +				PreprocessorDefinitions="NDEBUG"
    2.43 +				MkTypLibCompatible="true"
    2.44 +				SuppressStartupBanner="true"
    2.45 +				TargetEnvironment="1"
    2.46 +				TypeLibraryName=".\Release/testoverlay.tlb"
    2.47 +			/>
    2.48 +			<Tool
    2.49 +				Name="VCCLCompilerTool"
    2.50 +				InlineFunctionExpansion="1"
    2.51 +				AdditionalIncludeDirectories="..\..\..\include"
    2.52 +				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
    2.53 +				StringPooling="true"
    2.54 +				RuntimeLibrary="2"
    2.55 +				EnableFunctionLevelLinking="true"
    2.56 +				UsePrecompiledHeader="0"
    2.57 +				PrecompiledHeaderFile=".\Release/testoverlay.pch"
    2.58 +				AssemblerListingLocation=".\Release/"
    2.59 +				ObjectFile=".\Release/"
    2.60 +				ProgramDataBaseFileName=".\Release/"
    2.61 +				WarningLevel="3"
    2.62 +				SuppressStartupBanner="true"
    2.63 +				CompileAs="0"
    2.64 +			/>
    2.65 +			<Tool
    2.66 +				Name="VCManagedResourceCompilerTool"
    2.67 +			/>
    2.68 +			<Tool
    2.69 +				Name="VCResourceCompilerTool"
    2.70 +				PreprocessorDefinitions="NDEBUG"
    2.71 +				Culture="1033"
    2.72 +			/>
    2.73 +			<Tool
    2.74 +				Name="VCPreLinkEventTool"
    2.75 +			/>
    2.76 +			<Tool
    2.77 +				Name="VCLinkerTool"
    2.78 +				AdditionalOptions="/MACHINE:I386"
    2.79 +				OutputFile=".\Release/testoverlay.exe"
    2.80 +				LinkIncremental="1"
    2.81 +				SuppressStartupBanner="true"
    2.82 +				ProgramDatabaseFile=".\Release/testoverlay.pdb"
    2.83 +				SubSystem="2"
    2.84 +			/>
    2.85 +			<Tool
    2.86 +				Name="VCALinkTool"
    2.87 +			/>
    2.88 +			<Tool
    2.89 +				Name="VCManifestTool"
    2.90 +			/>
    2.91 +			<Tool
    2.92 +				Name="VCXDCMakeTool"
    2.93 +			/>
    2.94 +			<Tool
    2.95 +				Name="VCBscMakeTool"
    2.96 +			/>
    2.97 +			<Tool
    2.98 +				Name="VCFxCopTool"
    2.99 +			/>
   2.100 +			<Tool
   2.101 +				Name="VCAppVerifierTool"
   2.102 +			/>
   2.103 +			<Tool
   2.104 +				Name="VCWebDeploymentTool"
   2.105 +			/>
   2.106 +			<Tool
   2.107 +				Name="VCPostBuildEventTool"
   2.108 +			/>
   2.109 +		</Configuration>
   2.110 +		<Configuration
   2.111 +			Name="Debug|Win32"
   2.112 +			OutputDirectory=".\Debug"
   2.113 +			IntermediateDirectory=".\Debug"
   2.114 +			ConfigurationType="1"
   2.115 +			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
   2.116 +			UseOfMFC="0"
   2.117 +			ATLMinimizesCRunTimeLibraryUsage="false"
   2.118 +			>
   2.119 +			<Tool
   2.120 +				Name="VCPreBuildEventTool"
   2.121 +			/>
   2.122 +			<Tool
   2.123 +				Name="VCCustomBuildTool"
   2.124 +			/>
   2.125 +			<Tool
   2.126 +				Name="VCXMLDataGeneratorTool"
   2.127 +			/>
   2.128 +			<Tool
   2.129 +				Name="VCWebServiceProxyGeneratorTool"
   2.130 +			/>
   2.131 +			<Tool
   2.132 +				Name="VCMIDLTool"
   2.133 +				PreprocessorDefinitions="_DEBUG"
   2.134 +				MkTypLibCompatible="true"
   2.135 +				SuppressStartupBanner="true"
   2.136 +				TargetEnvironment="1"
   2.137 +				TypeLibraryName=".\Debug/testoverlay.tlb"
   2.138 +			/>
   2.139 +			<Tool
   2.140 +				Name="VCCLCompilerTool"
   2.141 +				Optimization="0"
   2.142 +				AdditionalIncludeDirectories="..\..\..\include"
   2.143 +				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
   2.144 +				RuntimeLibrary="2"
   2.145 +				UsePrecompiledHeader="0"
   2.146 +				PrecompiledHeaderFile=".\Debug/testoverlay.pch"
   2.147 +				AssemblerListingLocation=".\Debug/"
   2.148 +				ObjectFile=".\Debug/"
   2.149 +				ProgramDataBaseFileName=".\Debug/"
   2.150 +				WarningLevel="3"
   2.151 +				SuppressStartupBanner="true"
   2.152 +				DebugInformationFormat="4"
   2.153 +				CompileAs="0"
   2.154 +			/>
   2.155 +			<Tool
   2.156 +				Name="VCManagedResourceCompilerTool"
   2.157 +			/>
   2.158 +			<Tool
   2.159 +				Name="VCResourceCompilerTool"
   2.160 +				PreprocessorDefinitions="_DEBUG"
   2.161 +				Culture="1033"
   2.162 +			/>
   2.163 +			<Tool
   2.164 +				Name="VCPreLinkEventTool"
   2.165 +			/>
   2.166 +			<Tool
   2.167 +				Name="VCLinkerTool"
   2.168 +				AdditionalOptions="/MACHINE:I386"
   2.169 +				OutputFile=".\Debug/testoverlay.exe"
   2.170 +				LinkIncremental="2"
   2.171 +				SuppressStartupBanner="true"
   2.172 +				GenerateDebugInformation="true"
   2.173 +				ProgramDatabaseFile=".\Debug/testoverlay.pdb"
   2.174 +				SubSystem="2"
   2.175 +			/>
   2.176 +			<Tool
   2.177 +				Name="VCALinkTool"
   2.178 +			/>
   2.179 +			<Tool
   2.180 +				Name="VCManifestTool"
   2.181 +			/>
   2.182 +			<Tool
   2.183 +				Name="VCXDCMakeTool"
   2.184 +			/>
   2.185 +			<Tool
   2.186 +				Name="VCBscMakeTool"
   2.187 +			/>
   2.188 +			<Tool
   2.189 +				Name="VCFxCopTool"
   2.190 +			/>
   2.191 +			<Tool
   2.192 +				Name="VCAppVerifierTool"
   2.193 +			/>
   2.194 +			<Tool
   2.195 +				Name="VCWebDeploymentTool"
   2.196 +			/>
   2.197 +			<Tool
   2.198 +				Name="VCPostBuildEventTool"
   2.199 +			/>
   2.200 +		</Configuration>
   2.201 +	</Configurations>
   2.202 +	<References>
   2.203 +	</References>
   2.204 +	<Files>
   2.205 +		<File
   2.206 +			RelativePath="..\..\Sdl\Debug\SDL.lib"
   2.207 +			>
   2.208 +		</File>
   2.209 +		<File
   2.210 +			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
   2.211 +			>
   2.212 +		</File>
   2.213 +		<File
   2.214 +			RelativePath="..\..\..\test\testoverlay.c"
   2.215 +			>
   2.216 +		</File>
   2.217 +	</Files>
   2.218 +	<Globals>
   2.219 +	</Globals>
   2.220 +</VisualStudioProject>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/VisualC/tests/testoverlay2/testoverlay2.dsp	Mon Nov 24 23:25:36 2008 +0000
     3.3 @@ -0,0 +1,102 @@
     3.4 +# Microsoft Developer Studio Project File - Name="testoverlay2" - Package Owner=<4>
     3.5 +# Microsoft Developer Studio Generated Build File, Format Version 5.00
     3.6 +# ** DO NOT EDIT **
     3.7 +
     3.8 +# TARGTYPE "Win32 (x86) Application" 0x0101
     3.9 +
    3.10 +CFG=testoverlay2 - Win32 Debug
    3.11 +!MESSAGE This is not a valid makefile. To build this project using NMAKE,
    3.12 +!MESSAGE use the Export Makefile command and run
    3.13 +!MESSAGE 
    3.14 +!MESSAGE NMAKE /f "testoverlay2.mak".
    3.15 +!MESSAGE 
    3.16 +!MESSAGE You can specify a configuration when running NMAKE
    3.17 +!MESSAGE by defining the macro CFG on the command line. For example:
    3.18 +!MESSAGE 
    3.19 +!MESSAGE NMAKE /f "testoverlay2.mak" CFG="testoverlay2 - Win32 Debug"
    3.20 +!MESSAGE 
    3.21 +!MESSAGE Possible choices for configuration are:
    3.22 +!MESSAGE 
    3.23 +!MESSAGE "testoverlay2 - Win32 Release" (based on "Win32 (x86) Application")
    3.24 +!MESSAGE "testoverlay2 - Win32 Debug" (based on "Win32 (x86) Application")
    3.25 +!MESSAGE 
    3.26 +
    3.27 +# Begin Project
    3.28 +# PROP Scc_ProjName ""
    3.29 +# PROP Scc_LocalPath ""
    3.30 +CPP=cl.exe
    3.31 +MTL=midl.exe
    3.32 +RSC=rc.exe
    3.33 +
    3.34 +!IF  "$(CFG)" == "testoverlay2 - Win32 Release"
    3.35 +
    3.36 +# PROP BASE Use_MFC 0
    3.37 +# PROP BASE Use_Debug_Libraries 0
    3.38 +# PROP BASE Output_Dir "Release"
    3.39 +# PROP BASE Intermediate_Dir "Release"
    3.40 +# PROP BASE Target_Dir ""
    3.41 +# PROP Use_MFC 0
    3.42 +# PROP Use_Debug_Libraries 0
    3.43 +# PROP Output_Dir "Release"
    3.44 +# PROP Intermediate_Dir "Release"
    3.45 +# PROP Ignore_Export_Lib 0
    3.46 +# PROP Target_Dir ""
    3.47 +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
    3.48 +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
    3.49 +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
    3.50 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
    3.51 +# ADD BASE RSC /l 0x409 /d "NDEBUG"
    3.52 +# ADD RSC /l 0x409 /d "NDEBUG"
    3.53 +BSC32=bscmake.exe
    3.54 +# ADD BASE BSC32 /nologo
    3.55 +# ADD BSC32 /nologo
    3.56 +LINK32=link.exe
    3.57 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
    3.58 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
    3.59 +
    3.60 +!ELSEIF  "$(CFG)" == "testoverlay2 - Win32 Debug"
    3.61 +
    3.62 +# PROP BASE Use_MFC 0
    3.63 +# PROP BASE Use_Debug_Libraries 1
    3.64 +# PROP BASE Output_Dir "Debug"
    3.65 +# PROP BASE Intermediate_Dir "Debug"
    3.66 +# PROP BASE Target_Dir ""
    3.67 +# PROP Use_MFC 0
    3.68 +# PROP Use_Debug_Libraries 1
    3.69 +# PROP Output_Dir "Debug"
    3.70 +# PROP Intermediate_Dir "Debug"
    3.71 +# PROP Ignore_Export_Lib 0
    3.72 +# PROP Target_Dir ""
    3.73 +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
    3.74 +# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
    3.75 +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
    3.76 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
    3.77 +# ADD BASE RSC /l 0x409 /d "_DEBUG"
    3.78 +# ADD RSC /l 0x409 /d "_DEBUG"
    3.79 +BSC32=bscmake.exe
    3.80 +# ADD BASE BSC32 /nologo
    3.81 +# ADD BSC32 /nologo
    3.82 +LINK32=link.exe
    3.83 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
    3.84 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
    3.85 +
    3.86 +!ENDIF 
    3.87 +
    3.88 +# Begin Target
    3.89 +
    3.90 +# Name "testoverlay2 - Win32 Release"
    3.91 +# Name "testoverlay2 - Win32 Debug"
    3.92 +# Begin Source File
    3.93 +
    3.94 +SOURCE=..\..\Sdl\Debug\SDL.lib
    3.95 +# End Source File
    3.96 +# Begin Source File
    3.97 +
    3.98 +SOURCE=..\..\SDLmain\Debug\SDLmain.lib
    3.99 +# End Source File
   3.100 +# Begin Source File
   3.101 +
   3.102 +SOURCE=..\..\..\test\testoverlay2.c
   3.103 +# End Source File
   3.104 +# End Target
   3.105 +# End Project
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/VisualC/tests/testoverlay2/testoverlay2.vcproj	Mon Nov 24 23:25:36 2008 +0000
     4.3 @@ -0,0 +1,217 @@
     4.4 +<?xml version="1.0" encoding="Windows-1252"?>
     4.5 +<VisualStudioProject
     4.6 +	ProjectType="Visual C++"
     4.7 +	Version="8.00"
     4.8 +	Name="testoverlay2"
     4.9 +	ProjectGUID="{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
    4.10 +	>
    4.11 +	<Platforms>
    4.12 +		<Platform
    4.13 +			Name="Win32"
    4.14 +		/>
    4.15 +	</Platforms>
    4.16 +	<ToolFiles>
    4.17 +	</ToolFiles>
    4.18 +	<Configurations>
    4.19 +		<Configuration
    4.20 +			Name="Release|Win32"
    4.21 +			OutputDirectory=".\Release"
    4.22 +			IntermediateDirectory=".\Release"
    4.23 +			ConfigurationType="1"
    4.24 +			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
    4.25 +			UseOfMFC="0"
    4.26 +			ATLMinimizesCRunTimeLibraryUsage="false"
    4.27 +			>
    4.28 +			<Tool
    4.29 +				Name="VCPreBuildEventTool"
    4.30 +			/>
    4.31 +			<Tool
    4.32 +				Name="VCCustomBuildTool"
    4.33 +			/>
    4.34 +			<Tool
    4.35 +				Name="VCXMLDataGeneratorTool"
    4.36 +			/>
    4.37 +			<Tool
    4.38 +				Name="VCWebServiceProxyGeneratorTool"
    4.39 +			/>
    4.40 +			<Tool
    4.41 +				Name="VCMIDLTool"
    4.42 +				PreprocessorDefinitions="NDEBUG"
    4.43 +				MkTypLibCompatible="true"
    4.44 +				SuppressStartupBanner="true"
    4.45 +				TargetEnvironment="1"
    4.46 +				TypeLibraryName=".\Release/testoverlay2.tlb"
    4.47 +			/>
    4.48 +			<Tool
    4.49 +				Name="VCCLCompilerTool"
    4.50 +				InlineFunctionExpansion="1"
    4.51 +				AdditionalIncludeDirectories="..\..\..\include"
    4.52 +				PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
    4.53 +				StringPooling="true"
    4.54 +				RuntimeLibrary="2"
    4.55 +				EnableFunctionLevelLinking="true"
    4.56 +				UsePrecompiledHeader="0"
    4.57 +				PrecompiledHeaderFile=".\Release/testoverlay2.pch"
    4.58 +				AssemblerListingLocation=".\Release/"
    4.59 +				ObjectFile=".\Release/"
    4.60 +				ProgramDataBaseFileName=".\Release/"
    4.61 +				WarningLevel="3"
    4.62 +				SuppressStartupBanner="true"
    4.63 +				CompileAs="0"
    4.64 +			/>
    4.65 +			<Tool
    4.66 +				Name="VCManagedResourceCompilerTool"
    4.67 +			/>
    4.68 +			<Tool
    4.69 +				Name="VCResourceCompilerTool"
    4.70 +				PreprocessorDefinitions="NDEBUG"
    4.71 +				Culture="1033"
    4.72 +			/>
    4.73 +			<Tool
    4.74 +				Name="VCPreLinkEventTool"
    4.75 +			/>
    4.76 +			<Tool
    4.77 +				Name="VCLinkerTool"
    4.78 +				AdditionalOptions="/MACHINE:I386"
    4.79 +				OutputFile=".\Release/testoverlay2.exe"
    4.80 +				LinkIncremental="1"
    4.81 +				SuppressStartupBanner="true"
    4.82 +				ProgramDatabaseFile=".\Release/testoverlay2.pdb"
    4.83 +				SubSystem="2"
    4.84 +			/>
    4.85 +			<Tool
    4.86 +				Name="VCALinkTool"
    4.87 +			/>
    4.88 +			<Tool
    4.89 +				Name="VCManifestTool"
    4.90 +			/>
    4.91 +			<Tool
    4.92 +				Name="VCXDCMakeTool"
    4.93 +			/>
    4.94 +			<Tool
    4.95 +				Name="VCBscMakeTool"
    4.96 +			/>
    4.97 +			<Tool
    4.98 +				Name="VCFxCopTool"
    4.99 +			/>
   4.100 +			<Tool
   4.101 +				Name="VCAppVerifierTool"
   4.102 +			/>
   4.103 +			<Tool
   4.104 +				Name="VCWebDeploymentTool"
   4.105 +			/>
   4.106 +			<Tool
   4.107 +				Name="VCPostBuildEventTool"
   4.108 +			/>
   4.109 +		</Configuration>
   4.110 +		<Configuration
   4.111 +			Name="Debug|Win32"
   4.112 +			OutputDirectory=".\Debug"
   4.113 +			IntermediateDirectory=".\Debug"
   4.114 +			ConfigurationType="1"
   4.115 +			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
   4.116 +			UseOfMFC="0"
   4.117 +			ATLMinimizesCRunTimeLibraryUsage="false"
   4.118 +			>
   4.119 +			<Tool
   4.120 +				Name="VCPreBuildEventTool"
   4.121 +			/>
   4.122 +			<Tool
   4.123 +				Name="VCCustomBuildTool"
   4.124 +			/>
   4.125 +			<Tool
   4.126 +				Name="VCXMLDataGeneratorTool"
   4.127 +			/>
   4.128 +			<Tool
   4.129 +				Name="VCWebServiceProxyGeneratorTool"
   4.130 +			/>
   4.131 +			<Tool
   4.132 +				Name="VCMIDLTool"
   4.133 +				PreprocessorDefinitions="_DEBUG"
   4.134 +				MkTypLibCompatible="true"
   4.135 +				SuppressStartupBanner="true"
   4.136 +				TargetEnvironment="1"
   4.137 +				TypeLibraryName=".\Debug/testoverlay2.tlb"
   4.138 +			/>
   4.139 +			<Tool
   4.140 +				Name="VCCLCompilerTool"
   4.141 +				Optimization="0"
   4.142 +				AdditionalIncludeDirectories="..\..\..\include"
   4.143 +				PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
   4.144 +				RuntimeLibrary="2"
   4.145 +				UsePrecompiledHeader="0"
   4.146 +				PrecompiledHeaderFile=".\Debug/testoverlay2.pch"
   4.147 +				AssemblerListingLocation=".\Debug/"
   4.148 +				ObjectFile=".\Debug/"
   4.149 +				ProgramDataBaseFileName=".\Debug/"
   4.150 +				WarningLevel="3"
   4.151 +				SuppressStartupBanner="true"
   4.152 +				DebugInformationFormat="4"
   4.153 +				CompileAs="0"
   4.154 +			/>
   4.155 +			<Tool
   4.156 +				Name="VCManagedResourceCompilerTool"
   4.157 +			/>
   4.158 +			<Tool
   4.159 +				Name="VCResourceCompilerTool"
   4.160 +				PreprocessorDefinitions="_DEBUG"
   4.161 +				Culture="1033"
   4.162 +			/>
   4.163 +			<Tool
   4.164 +				Name="VCPreLinkEventTool"
   4.165 +			/>
   4.166 +			<Tool
   4.167 +				Name="VCLinkerTool"
   4.168 +				AdditionalOptions="/MACHINE:I386"
   4.169 +				OutputFile=".\Debug/testoverlay2.exe"
   4.170 +				LinkIncremental="2"
   4.171 +				SuppressStartupBanner="true"
   4.172 +				GenerateDebugInformation="true"
   4.173 +				ProgramDatabaseFile=".\Debug/testoverlay2.pdb"
   4.174 +				SubSystem="2"
   4.175 +			/>
   4.176 +			<Tool
   4.177 +				Name="VCALinkTool"
   4.178 +			/>
   4.179 +			<Tool
   4.180 +				Name="VCManifestTool"
   4.181 +			/>
   4.182 +			<Tool
   4.183 +				Name="VCXDCMakeTool"
   4.184 +			/>
   4.185 +			<Tool
   4.186 +				Name="VCBscMakeTool"
   4.187 +			/>
   4.188 +			<Tool
   4.189 +				Name="VCFxCopTool"
   4.190 +			/>
   4.191 +			<Tool
   4.192 +				Name="VCAppVerifierTool"
   4.193 +			/>
   4.194 +			<Tool
   4.195 +				Name="VCWebDeploymentTool"
   4.196 +			/>
   4.197 +			<Tool
   4.198 +				Name="VCPostBuildEventTool"
   4.199 +			/>
   4.200 +		</Configuration>
   4.201 +	</Configurations>
   4.202 +	<References>
   4.203 +	</References>
   4.204 +	<Files>
   4.205 +		<File
   4.206 +			RelativePath="..\..\Sdl\Debug\SDL.lib"
   4.207 +			>
   4.208 +		</File>
   4.209 +		<File
   4.210 +			RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
   4.211 +			>
   4.212 +		</File>
   4.213 +		<File
   4.214 +			RelativePath="..\..\..\test\testoverlay2.c"
   4.215 +			>
   4.216 +		</File>
   4.217 +	</Files>
   4.218 +	<Globals>
   4.219 +	</Globals>
   4.220 +</VisualStudioProject>
     5.1 --- a/VisualC/tests/tests.dsw	Mon Nov 24 21:43:02 2008 +0000
     5.2 +++ b/VisualC/tests/tests.dsw	Mon Nov 24 23:25:36 2008 +0000
     5.3 @@ -99,6 +99,30 @@
     5.4  
     5.5  ###############################################################################
     5.6  
     5.7 +Project: "testoverlay"=".\testoverlay\testoverlay.dsp" - Package Owner=<4>
     5.8 +
     5.9 +Package=<5>
    5.10 +{{{
    5.11 +}}}
    5.12 +
    5.13 +Package=<4>
    5.14 +{{{
    5.15 +}}}
    5.16 +
    5.17 +###############################################################################
    5.18 +
    5.19 +Project: "testoverlay2"=".\testoverlay2\testoverlay2.dsp" - Package Owner=<4>
    5.20 +
    5.21 +Package=<5>
    5.22 +{{{
    5.23 +}}}
    5.24 +
    5.25 +Package=<4>
    5.26 +{{{
    5.27 +}}}
    5.28 +
    5.29 +###############################################################################
    5.30 +
    5.31  Project: "testpalette"=".\testpalette\testpalette.dsp" - Package Owner=<4>
    5.32  
    5.33  Package=<5>
     6.1 --- a/VisualC/tests/tests.sln	Mon Nov 24 21:43:02 2008 +0000
     6.2 +++ b/VisualC/tests/tests.sln	Mon Nov 24 23:25:36 2008 +0000
     6.3 @@ -28,6 +28,10 @@
     6.4  EndProject
     6.5  Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "checkkeys\checkkeys.vcproj", "{26828762-C95D-4637-9CB1-7F0979523813}"
     6.6  EndProject
     6.7 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay", "testoverlay\testoverlay.vcproj", "{9E320A14-B443-4DD7-8725-B7020DCFF730}"
     6.8 +EndProject
     6.9 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "testoverlay2\testoverlay2.vcproj", "{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}"
    6.10 +EndProject
    6.11  Global
    6.12  	GlobalSection(SolutionConfigurationPlatforms) = preSolution
    6.13  		Debug|Win32 = Debug|Win32
    6.14 @@ -90,6 +94,14 @@
    6.15  		{26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32
    6.16  		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32
    6.17  		{26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32
    6.18 +		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Debug|Win32.ActiveCfg = Debug|Win32
    6.19 +		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Debug|Win32.Build.0 = Debug|Win32
    6.20 +		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Release|Win32.ActiveCfg = Release|Win32
    6.21 +		{9E320A14-B443-4DD7-8725-B7020DCFF730}.Release|Win32.Build.0 = Release|Win32
    6.22 +		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.ActiveCfg = Debug|Win32
    6.23 +		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.Build.0 = Debug|Win32
    6.24 +		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.ActiveCfg = Release|Win32
    6.25 +		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Release|Win32.Build.0 = Release|Win32
    6.26  	EndGlobalSection
    6.27  	GlobalSection(SolutionProperties) = preSolution
    6.28  		HideSolutionNode = FALSE
     7.1 --- a/src/SDL_compat.c	Mon Nov 24 21:43:02 2008 +0000
     7.2 +++ b/src/SDL_compat.c	Mon Nov 24 23:25:36 2008 +0000
     7.3 @@ -28,6 +28,7 @@
     7.4  
     7.5  #include "video/SDL_sysvideo.h"
     7.6  #include "video/SDL_pixels_c.h"
     7.7 +#include "video/SDL_yuv_sw_c.h"
     7.8  
     7.9  static SDL_WindowID SDL_VideoWindow = 0;
    7.10  static SDL_RendererInfo SDL_VideoRendererInfo;
    7.11 @@ -1349,6 +1350,8 @@
    7.12      Uint16 pitches[3];
    7.13      Uint8 *planes[3];
    7.14  
    7.15 +	SDL_SW_YUVTexture *sw;
    7.16 +
    7.17      SDL_TextureID textureID;
    7.18  };
    7.19  
    7.20 @@ -1431,7 +1434,20 @@
    7.21  
    7.22      overlay->hwdata->textureID =
    7.23          SDL_CreateTexture(texture_format, SDL_TEXTUREACCESS_STREAMING, w, h);
    7.24 -    if (!overlay->hwdata->textureID) {
    7.25 +    if (overlay->hwdata->textureID) {
    7.26 +		overlay->hwdata->sw = NULL;
    7.27 +	} else {
    7.28 +		overlay->hwdata->sw = SDL_SW_CreateYUVTexture(texture_format, w, h);
    7.29 +		if (!overlay->hwdata->sw) {
    7.30 +			SDL_FreeYUVOverlay(overlay);
    7.31 +			return NULL;
    7.32 +		}
    7.33 +
    7.34 +		/* Create a supported RGB format texture for display */
    7.35 +		overlay->hwdata->textureID =
    7.36 +			SDL_CreateTexture(SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_STREAMING, w, h);
    7.37 +	}
    7.38 +	if (!overlay->hwdata->textureID) {
    7.39          SDL_FreeYUVOverlay(overlay);
    7.40          return NULL;
    7.41      }
    7.42 @@ -1449,10 +1465,16 @@
    7.43          SDL_SetError("Passed a NULL overlay");
    7.44          return -1;
    7.45      }
    7.46 -    if (SDL_LockTexture(overlay->hwdata->textureID, NULL, 1, &pixels, &pitch)
    7.47 -        < 0) {
    7.48 -        return -1;
    7.49 -    }
    7.50 +	if (overlay->hwdata->sw) {
    7.51 +		if (SDL_SW_QueryYUVTexturePixels(overlay->hwdata->sw, &pixels, &pitch) < 0) {
    7.52 +			return -1;
    7.53 +		}
    7.54 +	} else {
    7.55 +		if (SDL_LockTexture(overlay->hwdata->textureID, NULL, 1, &pixels, &pitch)
    7.56 +			< 0) {
    7.57 +			return -1;
    7.58 +		}
    7.59 +	}
    7.60      overlay->pixels[0] = (Uint8 *) pixels;
    7.61      overlay->pitches[0] = pitch;
    7.62      switch (overlay->format) {
    7.63 @@ -1479,7 +1501,22 @@
    7.64      if (!overlay) {
    7.65          return;
    7.66      }
    7.67 -    SDL_UnlockTexture(overlay->hwdata->textureID);
    7.68 +	if (overlay->hwdata->sw) {
    7.69 +		void *pixels;
    7.70 +		int pitch;
    7.71 +		if (SDL_LockTexture(overlay->hwdata->textureID, NULL, 1, &pixels, &pitch) == 0) {
    7.72 +			SDL_Rect srcrect;
    7.73 +
    7.74 +			srcrect.x = 0;
    7.75 +			srcrect.y = 0;
    7.76 +			srcrect.w = overlay->w;
    7.77 +			srcrect.h = overlay->h;
    7.78 +			SDL_SW_CopyYUVToRGB(overlay->hwdata->sw, &srcrect, SDL_PIXELFORMAT_RGB888, overlay->w, overlay->h, pixels, pitch);
    7.79 +			SDL_UnlockTexture(overlay->hwdata->textureID);
    7.80 +		}
    7.81 +	} else {
    7.82 +		SDL_UnlockTexture(overlay->hwdata->textureID);
    7.83 +	}
    7.84  }
    7.85  
    7.86  int
     8.1 --- a/src/stdlib/SDL_stdlib.c	Mon Nov 24 21:43:02 2008 +0000
     8.2 +++ b/src/stdlib/SDL_stdlib.c	Mon Nov 24 23:25:36 2008 +0000
     8.3 @@ -90,7 +90,6 @@
     8.4  }
     8.5  
     8.6  void
     8.7 -__declspec(naked)
     8.8  _ftol2_sse()
     8.9  {
    8.10      _ftol();
     9.1 --- a/src/video/SDL_renderer_sw.c	Mon Nov 24 21:43:02 2008 +0000
     9.2 +++ b/src/video/SDL_renderer_sw.c	Mon Nov 24 23:25:36 2008 +0000
     9.3 @@ -361,7 +361,7 @@
     9.4  SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
     9.5  {
     9.6      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
     9.7 -        texture->driverdata = SDL_SW_CreateYUVTexture(texture);
     9.8 +        texture->driverdata = SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
     9.9      } else {
    9.10          int bpp;
    9.11          Uint32 Rmask, Gmask, Bmask, Amask;
    10.1 --- a/src/video/SDL_yuv_sw.c	Mon Nov 24 21:43:02 2008 +0000
    10.2 +++ b/src/video/SDL_yuv_sw.c	Mon Nov 24 23:25:36 2008 +0000
    10.3 @@ -91,9 +91,9 @@
    10.4  
    10.5  struct SDL_SW_YUVTexture
    10.6  {
    10.7 -    SDL_Texture *texture;
    10.8 -
    10.9 +	Uint32 format;
   10.10      Uint32 target_format;
   10.11 +	int w, h;
   10.12      Uint8 *pixels;
   10.13      int *colortab;
   10.14      Uint32 *rgb_2_pix;
   10.15 @@ -974,7 +974,7 @@
   10.16      }
   10.17  
   10.18      /* You have chosen wisely... */
   10.19 -    switch (swdata->texture->format) {
   10.20 +    switch (swdata->format) {
   10.21      case SDL_PIXELFORMAT_YV12:
   10.22      case SDL_PIXELFORMAT_IYUV:
   10.23          if (SDL_BYTESPERPIXEL(target_format) == 2) {
   10.24 @@ -982,7 +982,7 @@
   10.25              /* inline assembly functions */
   10.26              if (SDL_HasMMX() && (Rmask == 0xF800) &&
   10.27                  (Gmask == 0x07E0) && (Bmask == 0x001F)
   10.28 -                && (swdata->texture->w & 15) == 0) {
   10.29 +                && (swdata->w & 15) == 0) {
   10.30  /*printf("Using MMX 16-bit 565 dither\n");*/
   10.31                  swdata->Display1X = Color565DitherYV12MMX1X;
   10.32              } else {
   10.33 @@ -1003,7 +1003,7 @@
   10.34              /* inline assembly functions */
   10.35              if (SDL_HasMMX() && (Rmask == 0x00FF0000) &&
   10.36                  (Gmask == 0x0000FF00) &&
   10.37 -                (Bmask == 0x000000FF) && (swdata->texture->w & 15) == 0) {
   10.38 +                (Bmask == 0x000000FF) && (swdata->w & 15) == 0) {
   10.39  /*printf("Using MMX 32-bit dither\n");*/
   10.40                  swdata->Display1X = ColorRGBDitherYV12MMX1X;
   10.41              } else {
   10.42 @@ -1045,7 +1045,7 @@
   10.43  }
   10.44  
   10.45  SDL_SW_YUVTexture *
   10.46 -SDL_SW_CreateYUVTexture(SDL_Texture * texture)
   10.47 +SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
   10.48  {
   10.49      SDL_SW_YUVTexture *swdata;
   10.50      int *Cr_r_tab;
   10.51 @@ -1061,7 +1061,7 @@
   10.52          return NULL;
   10.53      }
   10.54  
   10.55 -    switch (texture->format) {
   10.56 +    switch (format) {
   10.57      case SDL_PIXELFORMAT_YV12:
   10.58      case SDL_PIXELFORMAT_IYUV:
   10.59      case SDL_PIXELFORMAT_YUY2:
   10.60 @@ -1073,9 +1073,11 @@
   10.61          return NULL;
   10.62      }
   10.63  
   10.64 -    swdata->texture = texture;
   10.65 +    swdata->format = format;
   10.66      swdata->target_format = SDL_PIXELFORMAT_UNKNOWN;
   10.67 -    swdata->pixels = (Uint8 *) SDL_malloc(texture->w * texture->h * 2);
   10.68 +	swdata->w = w;
   10.69 +	swdata->h = h;
   10.70 +    swdata->pixels = (Uint8 *) SDL_malloc(w * h * 2);
   10.71      swdata->colortab = (int *) SDL_malloc(4 * 256 * sizeof(int));
   10.72      swdata->rgb_2_pix = (Uint32 *) SDL_malloc(3 * 768 * sizeof(Uint32));
   10.73      if (!swdata->pixels || !swdata->colortab || !swdata->rgb_2_pix) {
   10.74 @@ -1101,22 +1103,22 @@
   10.75      }
   10.76  
   10.77      /* Find the pitch and offset values for the overlay */
   10.78 -    switch (texture->format) {
   10.79 +    switch (format) {
   10.80      case SDL_PIXELFORMAT_YV12:
   10.81      case SDL_PIXELFORMAT_IYUV:
   10.82 -        swdata->pitches[0] = texture->w;
   10.83 +        swdata->pitches[0] = w;
   10.84          swdata->pitches[1] = swdata->pitches[0] / 2;
   10.85          swdata->pitches[2] = swdata->pitches[0] / 2;
   10.86          swdata->planes[0] = swdata->pixels;
   10.87          swdata->planes[1] =
   10.88 -            swdata->planes[0] + swdata->pitches[0] * texture->h;
   10.89 +            swdata->planes[0] + swdata->pitches[0] * h;
   10.90          swdata->planes[2] =
   10.91 -            swdata->planes[1] + swdata->pitches[1] * texture->h / 2;
   10.92 +            swdata->planes[1] + swdata->pitches[1] * h / 2;
   10.93          break;
   10.94      case SDL_PIXELFORMAT_YUY2:
   10.95      case SDL_PIXELFORMAT_UYVY:
   10.96      case SDL_PIXELFORMAT_YVYU:
   10.97 -        swdata->pitches[0] = texture->w * 2;
   10.98 +        swdata->pitches[0] = w * 2;
   10.99          swdata->planes[0] = swdata->pixels;
  10.100          break;
  10.101      default:
  10.102 @@ -1141,19 +1143,17 @@
  10.103  SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
  10.104                          const void *pixels, int pitch)
  10.105  {
  10.106 -    SDL_Texture *texture = swdata->texture;
  10.107 -
  10.108 -    switch (texture->format) {
  10.109 +    switch (swdata->format) {
  10.110      case SDL_PIXELFORMAT_YV12:
  10.111      case SDL_PIXELFORMAT_IYUV:
  10.112          if (rect
  10.113 -            && (rect->x != 0 || rect->y != 0 || rect->w != texture->w
  10.114 -                || rect->h != texture->h)) {
  10.115 +            && (rect->x != 0 || rect->y != 0 || rect->w != swdata->w
  10.116 +                || rect->h != swdata->h)) {
  10.117              SDL_SetError
  10.118                  ("YV12 and IYUV textures only support full surface updates");
  10.119              return -1;
  10.120          }
  10.121 -        SDL_memcpy(swdata->pixels, pixels, texture->h * texture->w * 2);
  10.122 +        SDL_memcpy(swdata->pixels, pixels, swdata->h * swdata->w * 2);
  10.123          break;
  10.124      case SDL_PIXELFORMAT_YUY2:
  10.125      case SDL_PIXELFORMAT_UYVY:
  10.126 @@ -1183,14 +1183,12 @@
  10.127  SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
  10.128                        int markDirty, void **pixels, int *pitch)
  10.129  {
  10.130 -    SDL_Texture *texture = swdata->texture;
  10.131 -
  10.132 -    switch (texture->format) {
  10.133 +    switch (swdata->format) {
  10.134      case SDL_PIXELFORMAT_YV12:
  10.135      case SDL_PIXELFORMAT_IYUV:
  10.136          if (rect
  10.137 -            && (rect->x != 0 || rect->y != 0 || rect->w != texture->w
  10.138 -                || rect->h != texture->h)) {
  10.139 +            && (rect->x != 0 || rect->y != 0 || rect->w != swdata->w
  10.140 +                || rect->h != swdata->h)) {
  10.141              SDL_SetError
  10.142                  ("YV12 and IYUV textures only support full surface locks");
  10.143              return -1;
  10.144 @@ -1213,7 +1211,6 @@
  10.145                      Uint32 target_format, int w, int h, void *pixels,
  10.146                      int pitch)
  10.147  {
  10.148 -    SDL_Texture *texture = swdata->texture;
  10.149      int stretch;
  10.150      int scale_2x;
  10.151      Uint8 *lum, *Cr, *Cb;
  10.152 @@ -1228,8 +1225,8 @@
  10.153  
  10.154      stretch = 0;
  10.155      scale_2x = 0;
  10.156 -    if (srcrect->x || srcrect->y || srcrect->w < texture->w
  10.157 -        || srcrect->h < texture->h) {
  10.158 +    if (srcrect->x || srcrect->y || srcrect->w < swdata->w
  10.159 +        || srcrect->h < swdata->h) {
  10.160          /* The source rectangle has been clipped.
  10.161             Using a scratch surface is easier than adding clipped
  10.162             source support to all the blitters, plus that would
  10.163 @@ -1268,7 +1265,7 @@
  10.164              SDL_PixelFormatEnumToMasks(target_format, &bpp, &Rmask, &Gmask,
  10.165                                         &Bmask, &Amask);
  10.166              swdata->stretch =
  10.167 -                SDL_CreateRGBSurface(0, texture->w, texture->h, bpp, Rmask,
  10.168 +                SDL_CreateRGBSurface(0, swdata->w, swdata->h, bpp, Rmask,
  10.169                                       Gmask, Bmask, Amask);
  10.170              if (!swdata->stretch) {
  10.171                  return (-1);
  10.172 @@ -1277,7 +1274,7 @@
  10.173          pixels = swdata->stretch->pixels;
  10.174          pitch = swdata->stretch->pitch;
  10.175      }
  10.176 -    switch (texture->format) {
  10.177 +    switch (swdata->format) {
  10.178      case SDL_PIXELFORMAT_YV12:
  10.179          lum = swdata->planes[0];
  10.180          Cr = swdata->planes[1];
  10.181 @@ -1310,13 +1307,13 @@
  10.182      mod = (pitch / SDL_BYTESPERPIXEL(target_format));
  10.183  
  10.184      if (scale_2x) {
  10.185 -        mod -= (texture->w * 2);
  10.186 +        mod -= (swdata->w * 2);
  10.187          swdata->Display2X(swdata->colortab, swdata->rgb_2_pix,
  10.188 -                          lum, Cr, Cb, pixels, texture->h, texture->w, mod);
  10.189 +                          lum, Cr, Cb, pixels, swdata->h, swdata->w, mod);
  10.190      } else {
  10.191 -        mod -= texture->w;
  10.192 +        mod -= swdata->w;
  10.193          swdata->Display1X(swdata->colortab, swdata->rgb_2_pix,
  10.194 -                          lum, Cr, Cb, pixels, texture->h, texture->w, mod);
  10.195 +                          lum, Cr, Cb, pixels, swdata->h, swdata->w, mod);
  10.196      }
  10.197      if (stretch) {
  10.198          SDL_Rect rect = *srcrect;
    11.1 --- a/src/video/SDL_yuv_sw_c.h	Mon Nov 24 21:43:02 2008 +0000
    11.2 +++ b/src/video/SDL_yuv_sw_c.h	Mon Nov 24 23:25:36 2008 +0000
    11.3 @@ -28,7 +28,7 @@
    11.4  
    11.5  typedef struct SDL_SW_YUVTexture SDL_SW_YUVTexture;
    11.6  
    11.7 -SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(SDL_Texture * texture);
    11.8 +SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(Uint32 format, int w, int h);
    11.9  int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture * swdata, void **pixels,
   11.10                                   int *pitch);
   11.11  int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
    12.1 --- a/src/video/win32/SDL_gdirender.c	Mon Nov 24 21:43:02 2008 +0000
    12.2 +++ b/src/video/win32/SDL_gdirender.c	Mon Nov 24 23:25:36 2008 +0000
    12.3 @@ -294,7 +294,7 @@
    12.4      texture->driverdata = data;
    12.5  
    12.6      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
    12.7 -        data->yuv = SDL_SW_CreateYUVTexture(texture);
    12.8 +        data->yuv = SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
    12.9          if (!data->yuv) {
   12.10              return -1;
   12.11          }