Skip to content

Commit

Permalink
Added additional demos to solution file.
Browse files Browse the repository at this point in the history
Fix image filter VS MMX compile.
  • Loading branch information
ferzkopp committed Apr 18, 2010
1 parent 209831c commit 715e2e6
Show file tree
Hide file tree
Showing 9 changed files with 1,411 additions and 1,373 deletions.
50 changes: 50 additions & 0 deletions SDL_gfx.sln
Expand Up @@ -25,6 +25,31 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestFramerate", "Test\TestF
{AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC} = {AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestGfxBlit", "Test\TestGfxBlit.vcproj", "{AE22EFD3-6F6D-48C0-AF3D-EF112306BEDC}"
ProjectSection(ProjectDependencies) = postProject
{AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC} = {AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestGfxTexture", "Test\TestGfxTexture.vcproj", "{AE22EFD3-6F6D-32C0-AA3D-EF190406BEDC}"
ProjectSection(ProjectDependencies) = postProject
{AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC} = {AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestImageFilter", "Test\TestImageFilter.vcproj", "{AE22AFD3-6F6D-48C0-AF3D-EF190406AAAA}"
ProjectSection(ProjectDependencies) = postProject
{AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC} = {AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestRotozoom", "Test\TestRotozoom.vcproj", "{AE98EFD3-6F6D-48C0-AF3D-EF560406BEDC}"
ProjectSection(ProjectDependencies) = postProject
{AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC} = {AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestShrink", "Test\TestShrink.vcproj", "{AE22EFD3-6161-48C0-123D-EF190406BEDC}"
ProjectSection(ProjectDependencies) = postProject
{AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC} = {AE22EFD3-6E6D-48C0-AF3D-EF190406BEDC}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand All @@ -51,6 +76,26 @@ Global
{AE22EFD3-6F6D-21C0-AF2D-EF190406BEDC}.Debug|Win32.Build.0 = Debug|Win32
{AE22EFD3-6F6D-21C0-AF2D-EF190406BEDC}.Release|Win32.ActiveCfg = Release|Win32
{AE22EFD3-6F6D-21C0-AF2D-EF190406BEDC}.Release|Win32.Build.0 = Release|Win32
{AE22EFD3-6F6D-48C0-AF3D-EF112306BEDC}.Debug|Win32.ActiveCfg = Debug|Win32
{AE22EFD3-6F6D-48C0-AF3D-EF112306BEDC}.Debug|Win32.Build.0 = Debug|Win32
{AE22EFD3-6F6D-48C0-AF3D-EF112306BEDC}.Release|Win32.ActiveCfg = Release|Win32
{AE22EFD3-6F6D-48C0-AF3D-EF112306BEDC}.Release|Win32.Build.0 = Release|Win32
{AE22EFD3-6F6D-32C0-AA3D-EF190406BEDC}.Debug|Win32.ActiveCfg = Debug|Win32
{AE22EFD3-6F6D-32C0-AA3D-EF190406BEDC}.Debug|Win32.Build.0 = Debug|Win32
{AE22EFD3-6F6D-32C0-AA3D-EF190406BEDC}.Release|Win32.ActiveCfg = Release|Win32
{AE22EFD3-6F6D-32C0-AA3D-EF190406BEDC}.Release|Win32.Build.0 = Release|Win32
{AE22AFD3-6F6D-48C0-AF3D-EF190406AAAA}.Debug|Win32.ActiveCfg = Debug|Win32
{AE22AFD3-6F6D-48C0-AF3D-EF190406AAAA}.Debug|Win32.Build.0 = Debug|Win32
{AE22AFD3-6F6D-48C0-AF3D-EF190406AAAA}.Release|Win32.ActiveCfg = Release|Win32
{AE22AFD3-6F6D-48C0-AF3D-EF190406AAAA}.Release|Win32.Build.0 = Release|Win32
{AE98EFD3-6F6D-48C0-AF3D-EF560406BEDC}.Debug|Win32.ActiveCfg = Debug|Win32
{AE98EFD3-6F6D-48C0-AF3D-EF560406BEDC}.Debug|Win32.Build.0 = Debug|Win32
{AE98EFD3-6F6D-48C0-AF3D-EF560406BEDC}.Release|Win32.ActiveCfg = Release|Win32
{AE98EFD3-6F6D-48C0-AF3D-EF560406BEDC}.Release|Win32.Build.0 = Release|Win32
{AE22EFD3-6161-48C0-123D-EF190406BEDC}.Debug|Win32.ActiveCfg = Debug|Win32
{AE22EFD3-6161-48C0-123D-EF190406BEDC}.Debug|Win32.Build.0 = Debug|Win32
{AE22EFD3-6161-48C0-123D-EF190406BEDC}.Release|Win32.ActiveCfg = Release|Win32
{AE22EFD3-6161-48C0-123D-EF190406BEDC}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -60,5 +105,10 @@ Global
{AE22EFD3-7F7D-48C0-AF3D-EF190406BEDC} = {0E209CE5-31A3-4039-9437-7F74DC13D8C8}
{AE33EFD3-6F6D-48C0-AF3D-EF190406BEDC} = {0E209CE5-31A3-4039-9437-7F74DC13D8C8}
{AE22EFD3-6F6D-21C0-AF2D-EF190406BEDC} = {0E209CE5-31A3-4039-9437-7F74DC13D8C8}
{AE22EFD3-6F6D-48C0-AF3D-EF112306BEDC} = {0E209CE5-31A3-4039-9437-7F74DC13D8C8}
{AE22EFD3-6F6D-32C0-AA3D-EF190406BEDC} = {0E209CE5-31A3-4039-9437-7F74DC13D8C8}
{AE22AFD3-6F6D-48C0-AF3D-EF190406AAAA} = {0E209CE5-31A3-4039-9437-7F74DC13D8C8}
{AE98EFD3-6F6D-48C0-AF3D-EF560406BEDC} = {0E209CE5-31A3-4039-9437-7F74DC13D8C8}
{AE22EFD3-6161-48C0-123D-EF190406BEDC} = {0E209CE5-31A3-4039-9437-7F74DC13D8C8}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions SDL_gfx.vcproj
Expand Up @@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""..\SDL-1.2.14\include""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DLL_EXPORT"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DLL_EXPORT;USE_MMX"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
Expand Down Expand Up @@ -91,7 +91,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\Test\$(ConfigurationName)&quot;&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\SDL-1.2.14\VisualC\SDL\Debug\SDL.dll&quot; &quot;$(SolutionDir)\Test\$(ConfigurationName)&quot;"
CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\Test\$(ConfigurationName)&quot;&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\SDL-1.2.14\VisualC\SDL\Debug\SDL.dll&quot; &quot;$(SolutionDir)\Test\$(ConfigurationName)&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Expand Down
25 changes: 12 additions & 13 deletions SDL_imageFilter.c
Expand Up @@ -815,7 +815,6 @@ int SDL_imageFilterMultNorASM(unsigned char *Src1, unsigned char *Src2, unsigned
L10141:
mov al, [edx] /* load a byte from Src1 */
mul [esi] /* mul with a byte from Src2 */
L10142:
mov [edi], al /* move a byte result to Dest */
inc edx /* increment Src1, Src2, Dest */
inc esi /* pointer registers by one */
Expand Down Expand Up @@ -1842,11 +1841,11 @@ int SDL_imageFilterAddByte(unsigned char *Src1, unsigned char *Dest, unsigned in
\param Dest Pointer to the start of the destination byte array (D).
\param SrcLength The number of bytes in the source array.
\param C Constant to add (C).
\param Cs Byteorder-swapped constant to add (Cs).
\param D Byteorder-swapped constant to add (Cs).
\return Returns 0 for success or -1 for error.
*/
int SDL_imageFilterAddUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned int C, unsigned int Cs)
int SDL_imageFilterAddUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned int C, unsigned int D)
{
#ifdef USE_MMX
#if !defined(GCC__)
Expand All @@ -1856,7 +1855,7 @@ int SDL_imageFilterAddUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned
/* ** Duplicate (int)C in 8 bytes of MM1 ** */
mov eax, C /* load C into EAX */
movd mm1, eax /* copy EAX into MM1 */
mov eax, Cs /* load Cs into EAX */
mov eax, D /* load D into EAX */
movd mm2, eax /* copy EAX into MM2 */
punpckldq mm1, mm2 /* fill higher bytes of MM1 with C */
mov eax, Src1 /* load Src1 address into eax */
Expand All @@ -1881,7 +1880,7 @@ int SDL_imageFilterAddUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned
/* ** Duplicate (int)C in 8 bytes of MM1 ** */
"mov %3, %%eax \n\t" /* load C into EAX */
"movd %%eax, %%mm1 \n\t" /* copy EAX into MM1 */
"mov %4, %%eax \n\t" /* load Cs into EAX */
"mov %4, %%eax \n\t" /* load D into EAX */
"movd %%eax, %%mm2 \n\t" /* copy EAX into MM2 */
"punpckldq %%mm2, %%mm1 \n\t" /* fill higher bytes of MM1 with C */
"mov %1, %%eax \n\t" /* load Src1 address into eax */
Expand All @@ -1902,7 +1901,7 @@ int SDL_imageFilterAddUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned
:"m"(Src1), /* %1 */
"m"(SrcLength), /* %2 */
"m"(C), /* %3 */
"m"(Cs) /* %4 */
"m"(D) /* %4 */
);
#endif
return (0);
Expand Down Expand Up @@ -2285,17 +2284,17 @@ int SDL_imageFilterSubByte(unsigned char *Src1, unsigned char *Dest, unsigned in
}

/*!
\brief Internal MMX Filter using SubUint: D = saturation0(S[i] - C[i % 4]), Cs=Swap32((uint)C)
\brief Internal MMX Filter using SubUint: D = saturation0(S[i] - Cs[i % 4]), Cs=Swap32((uint)C)
\param Src1 Pointer to the start of the source byte array (S).
\param Dest Pointer to the start of the destination byte array (D).
\param SrcLength The number of bytes in the source array.
\param C Constant to subtract (C).
\param Cs Byteorder-swapped constant to subtract (Cs).
\param D Byteorder-swapped constant to subtract (Cs).
\return Returns 0 for success or -1 for error.
*/
int SDL_imageFilterSubUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned int C, unsigned int Cs)
int SDL_imageFilterSubUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned int SrcLength, unsigned int C, unsigned int D)
{
#ifdef USE_MMX
#if !defined(GCC__)
Expand All @@ -2305,7 +2304,7 @@ int SDL_imageFilterSubUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned
/* ** Duplicate (int)C in 8 bytes of MM1 ** */
mov eax, C /* load C into EAX */
movd mm1, eax /* copy EAX into MM1 */
mov eax, Cs /* load Cs into EAX */
mov eax, D /* load D into EAX */
movd mm2, eax /* copy EAX into MM2 */
punpckldq mm1, mm2 /* fill higher bytes of MM1 with C */
mov eax, Src1 /* load Src1 address into eax */
Expand All @@ -2330,7 +2329,7 @@ int SDL_imageFilterSubUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned
/* ** Duplicate (int)C in 8 bytes of MM1 ** */
"mov %3, %%eax \n\t" /* load C into EAX */
"movd %%eax, %%mm1 \n\t" /* copy EAX into MM1 */
"mov %4, %%eax \n\t" /* load Cs into EAX */
"mov %4, %%eax \n\t" /* load D into EAX */
"movd %%eax, %%mm2 \n\t" /* copy EAX into MM2 */
"punpckldq %%mm2, %%mm1 \n\t" /* fill higher bytes of MM1 with C */
"mov %1, %%eax \n\t" /* load Src1 address into eax */
Expand All @@ -2350,7 +2349,7 @@ int SDL_imageFilterSubUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned
:"m"(Src1), /* %1 */
"m"(SrcLength), /* %2 */
"m"(C), /* %3 */
"m"(Cs) /* %4 */
"m"(D) /* %4 */
);
#endif
return (0);
Expand All @@ -2360,7 +2359,7 @@ int SDL_imageFilterSubUintMMX(unsigned char *Src1, unsigned char *Dest, unsigned
}

/*!
\brief Filter using SubUint: D = saturation0(S[i] - C[i % 4]), Cs=Swap32((uint)C)
\brief Filter using SubUint: D = saturation0(S[i] - Cs[i % 4]), Cs=Swap32((uint)C)
\param Src1 Pointer to the start of the source byte array (S1).
\param Dest Pointer to the start of the destination byte array (D).
Expand Down
9 changes: 7 additions & 2 deletions Test/TestFonts.c
Expand Up @@ -144,10 +144,15 @@ char *LoadFontFile(int i)
sprintf(filename,"..\\Fonts\\%s",fontfile[i]);
if (!FileExists(filename))
{
sprintf(filename,"..\\..\\..\\Fonts\\%s",fontfile[i]);
sprintf(filename,"..\\..\\Fonts\\%s",fontfile[i]);
if (!FileExists(filename))
{
fprintf(stderr,"Cannot find fontfile: %s\n", fontfile[i]);
sprintf(filename,"..\\..\\..\\Fonts\\%s",fontfile[i]);
if (!FileExists(filename))
{
fprintf(stderr,"Cannot find fontfile: %s\n", fontfile[i]);
exit(-1);
}
}
}
}
Expand Down

0 comments on commit 715e2e6

Please sign in to comment.