1.1 --- a/Makefile.ds Sun Feb 06 23:48:31 2011 -0800
1.2 +++ b/Makefile.ds Sat Feb 12 19:16:09 2011 -0800
1.3 @@ -22,46 +22,57 @@
1.4 #endif
1.5
1.6 #CFLAGS=$(DEFS) -Iinclude
1.7 -CFLAGS = -mthumb -mthumb-interwork \
1.8 - -march=armv5te -mtune=arm946e-s \
1.9 - -O2 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
1.10 - -DARM9 -D__NDS__ -I$(DEVKITPRO)/libnds/include -DENABLE_NDS -DNO_SIGNAL_H -DDISABLE_THREADS -DPACKAGE=\"SDL\" -DVERSION=\"1.3\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 \
1.11 - -Iinclude -Isrc -Isrc/audio -Isrc/cdrom -Isrc/endian -Isrc/events -Isrc/joystick -Isrc/thread/nds -Isrc/thread -Isrc/timer -Isrc/video
1.12 +CFLAGS = -mthumb -mthumb-interwork \
1.13 + -march=armv5te -mtune=arm946e-s \
1.14 + -O2 -Wall -Wwrite-strings -Wpointer-arith \
1.15 + -DARM9 -D__NDS__ -I$(DEVKITPRO)/libnds/include -DENABLE_NDS -DNO_SIGNAL_H -DDISABLE_THREADS -DPACKAGE=\"SDL\" -DVERSION=\"1.3\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 \
1.16 + -Iinclude -Isrc -Isrc/audio -Isrc/cdrom -Isrc/endian -Isrc/events -Isrc/joystick -Isrc/thread/nds -Isrc/thread -Isrc/timer -Isrc/video
1.17
1.18 #src/audio/disk/SDL_diskaudio.c \
1.19 #src/audio/dummy/SDL_dummyaudio.c \
1.20
1.21 SRCS = \
1.22 src/SDL.c \
1.23 +src/SDL_assert.c \
1.24 src/SDL_compat.c \
1.25 src/SDL_error.c \
1.26 src/SDL_fatal.c \
1.27 -src/SDL_assert.c \
1.28 -src/audio/nds/SDL_ndsaudio.c \
1.29 +src/SDL_hints.c \
1.30 +src/SDL_log.c \
1.31 +src/atomic/SDL_atomic.c \
1.32 src/audio/SDL_audio.c \
1.33 src/audio/SDL_audiocvt.c \
1.34 src/audio/SDL_audiodev.c \
1.35 src/audio/SDL_audiotypecvt.c \
1.36 src/audio/SDL_mixer.c \
1.37 -src/audio/SDL_mixer_m68k.c \
1.38 src/audio/SDL_mixer_MMX.c \
1.39 src/audio/SDL_mixer_MMX_VC.c \
1.40 +src/audio/SDL_mixer_m68k.c \
1.41 src/audio/SDL_wave.c \
1.42 -src/cdrom/dummy/SDL_syscdrom.c \
1.43 -src/cdrom/SDL_cdrom.c \
1.44 +src/audio/nds/SDL_ndsaudio.c \
1.45 src/cpuinfo/SDL_cpuinfo.c \
1.46 src/events/SDL_events.c \
1.47 src/events/SDL_keyboard.c \
1.48 src/events/SDL_mouse.c \
1.49 src/events/SDL_quit.c \
1.50 +src/events/SDL_touch.c \
1.51 src/events/SDL_windowevents.c \
1.52 +src/events/nds/SDL_ndsgesture.c \
1.53 src/file/SDL_rwops.c \
1.54 +src/haptic/SDL_haptic.c \
1.55 +src/haptic/nds/SDL_syshaptic.c \
1.56 +src/joystick/SDL_joystick.c \
1.57 +src/joystick/nds/SDL_sysjoystick.c \
1.58 src/power/SDL_power.c \
1.59 src/power/nds/SDL_syspower.c \
1.60 -src/haptic/SDL_haptic.c \
1.61 -src/haptic/nds/SDL_syshaptic.c \
1.62 -src/joystick/nds/SDL_sysjoystick.c \
1.63 -src/joystick/SDL_joystick.c \
1.64 +src/render/SDL_render.c \
1.65 +src/render/SDL_yuv_sw.c \
1.66 +src/render/software/SDL_render_sw.c \
1.67 +src/render/software/SDL_blendpoint.c \
1.68 +src/render/software/SDL_drawline.c \
1.69 +src/render/software/SDL_blendline.c \
1.70 +src/render/software/SDL_blendfillrect.c \
1.71 +src/render/software/SDL_drawpoint.c \
1.72 src/stdlib/SDL_getenv.c \
1.73 src/stdlib/SDL_iconv.c \
1.74 src/stdlib/SDL_malloc.c \
1.75 @@ -73,37 +84,29 @@
1.76 src/thread/nds/SDL_sysmutex.c \
1.77 src/thread/nds/SDL_syssem.c \
1.78 src/thread/nds/SDL_systhread.c \
1.79 +src/timer/SDL_timer.c \
1.80 src/timer/nds/SDL_systimer.c \
1.81 -src/timer/SDL_timer.c \
1.82 -src/video/nds/SDL_ndsevents.c \
1.83 -src/video/nds/SDL_ndsrender.c \
1.84 -src/video/nds/SDL_ndsvideo.c \
1.85 -src/video/dummy/SDL_nullevents.c \
1.86 -src/video/dummy/SDL_nullrender.c \
1.87 -src/video/dummy/SDL_nullvideo.c \
1.88 +src/video/SDL_RLEaccel.c \
1.89 +src/video/SDL_blit.c \
1.90 src/video/SDL_blit_0.c \
1.91 src/video/SDL_blit_1.c \
1.92 src/video/SDL_blit_A.c \
1.93 +src/video/SDL_blit_N.c \
1.94 src/video/SDL_blit_auto.c \
1.95 -src/video/SDL_blit.c \
1.96 src/video/SDL_blit_copy.c \
1.97 -src/video/SDL_blit_N.c \
1.98 src/video/SDL_blit_slow.c \
1.99 src/video/SDL_bmp.c \
1.100 -src/video/SDL_drawline.c \
1.101 -src/video/SDL_drawpoint.c \
1.102 src/video/SDL_fillrect.c \
1.103 -src/video/SDL_gamma.c \
1.104 src/video/SDL_pixels.c \
1.105 src/video/SDL_rect.c \
1.106 -src/video/SDL_renderer_gl.c \
1.107 -src/video/SDL_renderer_sw.c \
1.108 -src/video/SDL_RLEaccel.c \
1.109 src/video/SDL_stretch.c \
1.110 src/video/SDL_surface.c \
1.111 src/video/SDL_video.c \
1.112 -src/video/SDL_yuv_mmx.c \
1.113 -src/video/SDL_yuv_sw.c \
1.114 +src/video/dummy/SDL_nullevents.c \
1.115 +src/video/dummy/SDL_nullvideo.c \
1.116 +src/video/nds/SDL_ndsevents.c \
1.117 +src/video/nds/SDL_ndsrender.c \
1.118 +src/video/nds/SDL_ndsvideo.c \
1.119
1.120 OBJS = $(SRCS:.c=.o)
1.121
1.122 @@ -113,7 +116,7 @@
1.123 test/nds-test-progs/sprite2/sprite2.nds \
1.124
1.125
1.126 -all: $(TARGET)
1.127 +all: $(TARGET) install nds_test
1.128
1.129 $(TARGET): copy_config \
1.130 $(OBJS)
1.131 @@ -126,7 +129,9 @@
1.132 @cp include/*.h $(DEVKITPRO)/libnds/include/SDL/
1.133
1.134 nds_test:
1.135 - $(MAKE) -C test/nds-test-progs
1.136 + $(MAKE) -C test/nds-test-progs/general
1.137 +# $(MAKE) -C test/nds-test-progs/sprite
1.138 +# $(MAKE) -C test/nds-test-progs/sprite2
1.139
1.140 copy_config:
1.141 @cp include/SDL_config.h.default include/SDL_config.h
2.1 --- a/Makefile.in Sun Feb 06 23:48:31 2011 -0800
2.2 +++ b/Makefile.in Sat Feb 12 19:16:09 2011 -0800
2.3 @@ -59,6 +59,7 @@
2.4 SDL_keyboard.h \
2.5 SDL_keysym.h \
2.6 SDL_loadso.h \
2.7 + SDL_log.h \
2.8 SDL_main.h \
2.9 SDL_mouse.h \
2.10 SDL_mutex.h \
3.1 --- a/VisualC/SDL/SDL_VS2005.vcproj Sun Feb 06 23:48:31 2011 -0800
3.2 +++ b/VisualC/SDL/SDL_VS2005.vcproj Sat Feb 12 19:16:09 2011 -0800
3.3 @@ -900,10 +900,6 @@
3.4 >
3.5 </File>
3.6 <File
3.7 - RelativePath="..\..\src\video\SDL_leaks.h"
3.8 - >
3.9 - </File>
3.10 - <File
3.11 RelativePath="..\..\src\stdlib\SDL_malloc.c"
3.12 >
3.13 </File>
4.1 --- a/VisualC/SDL/SDL_VS2008.vcproj Sun Feb 06 23:48:31 2011 -0800
4.2 +++ b/VisualC/SDL/SDL_VS2008.vcproj Sat Feb 12 19:16:09 2011 -0800
4.3 @@ -458,6 +458,10 @@
4.4 >
4.5 </File>
4.6 <File
4.7 + RelativePath="..\..\include\SDL_log.h"
4.8 + >
4.9 + </File>
4.10 + <File
4.11 RelativePath="..\..\include\SDL_main.h"
4.12 >
4.13 </File>
4.14 @@ -863,10 +867,6 @@
4.15 >
4.16 </File>
4.17 <File
4.18 - RelativePath="..\..\src\video\SDL_gamma.c"
4.19 - >
4.20 - </File>
4.21 - <File
4.22 RelativePath="..\..\src\events\SDL_gesture.c"
4.23 >
4.24 </File>
4.25 @@ -915,7 +915,7 @@
4.26 >
4.27 </File>
4.28 <File
4.29 - RelativePath="..\..\src\video\SDL_leaks.h"
4.30 + RelativePath="..\..\src\SDL_log.c"
4.31 >
4.32 </File>
4.33 <File
4.34 @@ -1047,6 +1047,14 @@
4.35 >
4.36 </File>
4.37 <File
4.38 + RelativePath="..\..\src\render\opengl\SDL_shaders_gl.c"
4.39 + >
4.40 + </File>
4.41 + <File
4.42 + RelativePath="..\..\src\render\opengl\SDL_shaders_gl.h"
4.43 + >
4.44 + </File>
4.45 + <File
4.46 RelativePath="..\..\src\video\SDL_shape.c"
4.47 >
4.48 </File>
4.49 @@ -1219,14 +1227,6 @@
4.50 >
4.51 </File>
4.52 <File
4.53 - RelativePath="..\..\src\video\windows\SDL_windowsgamma.c"
4.54 - >
4.55 - </File>
4.56 - <File
4.57 - RelativePath="..\..\src\video\windows\SDL_windowsgamma.h"
4.58 - >
4.59 - </File>
4.60 - <File
4.61 RelativePath="..\..\src\video\windows\SDL_windowskeyboard.c"
4.62 >
4.63 </File>
5.1 --- a/VisualC/SDL/SDL_VS2010.vcxproj Sun Feb 06 23:48:31 2011 -0800
5.2 +++ b/VisualC/SDL/SDL_VS2010.vcxproj Sat Feb 12 19:16:09 2011 -0800
5.3 @@ -249,6 +249,7 @@
5.4 <ClInclude Include="..\..\include\SDL_keyboard.h" />
5.5 <ClInclude Include="..\..\include\SDL_keysym.h" />
5.6 <ClInclude Include="..\..\include\SDL_loadso.h" />
5.7 + <ClInclude Include="..\..\include\SDL_log.h" />
5.8 <ClInclude Include="..\..\include\SDL_main.h" />
5.9 <ClInclude Include="..\..\include\SDL_mouse.h" />
5.10 <ClInclude Include="..\..\include\SDL_mutex.h" />
5.11 @@ -284,6 +285,7 @@
5.12 <ClInclude Include="..\..\src\libm\math.h" />
5.13 <ClInclude Include="..\..\src\libm\math_private.h" />
5.14 <ClInclude Include="..\..\src\render\mmx.h" />
5.15 + <ClInclude Include="..\..\src\render\opengl\SDL_shaders_gl.h" />
5.16 <ClInclude Include="..\..\src\render\SDL_sysrender.h" />
5.17 <ClInclude Include="..\..\src\render\SDL_yuv_sw_c.h" />
5.18 <ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
5.19 @@ -313,7 +315,6 @@
5.20 <ClInclude Include="..\..\src\video\SDL_glfuncs.h" />
5.21 <ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
5.22 <ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
5.23 - <ClInclude Include="..\..\src\video\SDL_leaks.h" />
5.24 <ClInclude Include="..\..\src\audio\SDL_mixer_m68k.h" />
5.25 <ClInclude Include="..\..\src\audio\SDL_mixer_MMX.h" />
5.26 <ClInclude Include="..\..\src\audio\SDL_mixer_MMX_VC.h" />
5.27 @@ -339,7 +340,6 @@
5.28 <ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
5.29 <ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
5.30 <ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
5.31 - <ClInclude Include="..\..\src\video\windows\SDL_windowsgamma.h" />
5.32 <ClInclude Include="..\..\src\video\windows\SDL_windowskeyboard.h" />
5.33 <ClInclude Include="..\..\src\video\windows\SDL_windowsmodes.h" />
5.34 <ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
5.35 @@ -372,6 +372,7 @@
5.36 <ClCompile Include="..\..\src\libm\s_sin.c" />
5.37 <ClCompile Include="..\..\src\render\direct3d\SDL_render_d3d.c" />
5.38 <ClCompile Include="..\..\src\render\opengl\SDL_render_gl.c" />
5.39 + <ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
5.40 <ClCompile Include="..\..\src\render\SDL_render.c" />
5.41 <ClCompile Include="..\..\src\render\SDL_yuv_mmx.c" />
5.42 <ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
5.43 @@ -390,6 +391,7 @@
5.44 <ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
5.45 <ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
5.46 <ClCompile Include="..\..\src\SDL_hints.c" />
5.47 + <ClCompile Include="..\..\src\SDL_log.c" />
5.48 <ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
5.49 <ClCompile Include="..\..\src\video\SDL_blit.c" />
5.50 <ClCompile Include="..\..\src\video\SDL_blit_0.c" />
5.51 @@ -413,7 +415,6 @@
5.52 <ClCompile Include="..\..\src\events\SDL_events.c" />
5.53 <ClCompile Include="..\..\src\SDL_fatal.c" />
5.54 <ClCompile Include="..\..\src\video\SDL_fillrect.c" />
5.55 - <ClCompile Include="..\..\src\video\SDL_gamma.c" />
5.56 <ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
5.57 <ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
5.58 <ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
5.59 @@ -453,7 +454,6 @@
5.60 <ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
5.61 <ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
5.62 <ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
5.63 - <ClCompile Include="..\..\src\video\windows\SDL_windowsgamma.c" />
5.64 <ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
5.65 <ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
5.66 <ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
5.67 @@ -466,4 +466,4 @@
5.68 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
5.69 <ImportGroup Label="ExtensionTargets">
5.70 </ImportGroup>
5.71 -</Project>
5.72 \ No newline at end of file
5.73 +</Project>
6.1 --- a/VisualCE/SDL/SDL.vcproj Sun Feb 06 23:48:31 2011 -0800
6.2 +++ b/VisualCE/SDL/SDL.vcproj Sat Feb 12 19:16:09 2011 -0800
6.3 @@ -862,10 +862,6 @@
6.4 >
6.5 </File>
6.6 <File
6.7 - RelativePath="..\..\src\video\SDL_gamma.c"
6.8 - >
6.9 - </File>
6.10 - <File
6.11 RelativePath="..\..\src\events\SDL_gesture.c"
6.12 >
6.13 </File>
6.14 @@ -878,6 +874,10 @@
6.15 >
6.16 </File>
6.17 <File
6.18 + RelativePath="..\..\src\SDL_hints.c"
6.19 + >
6.20 + </File>
6.21 + <File
6.22 RelativePath="..\..\src\stdlib\SDL_iconv.c"
6.23 >
6.24 </File>
6.25 @@ -890,6 +890,10 @@
6.26 >
6.27 </File>
6.28 <File
6.29 + RelativePath="..\..\src\SDL_log.c"
6.30 + >
6.31 + </File>
6.32 + <File
6.33 RelativePath="..\..\src\stdlib\SDL_malloc.c"
6.34 >
6.35 </File>
6.36 @@ -938,7 +942,7 @@
6.37 >
6.38 </File>
6.39 <File
6.40 - RelativePath="..\..\src\render\software\SDL_renderer_sw.c"
6.41 + RelativePath="..\..\src\render\software\SDL_render_sw.c"
6.42 >
6.43 </File>
6.44 <File
6.45 @@ -1046,10 +1050,6 @@
6.46 >
6.47 </File>
6.48 <File
6.49 - RelativePath="..\..\src\video\windows\SDL_windowsgamma.c"
6.50 - >
6.51 - </File>
6.52 - <File
6.53 RelativePath="..\..\src\video\windows\SDL_windowskeyboard.c"
6.54 >
6.55 </File>
6.56 @@ -1231,18 +1231,46 @@
6.57 >
6.58 </File>
6.59 <File
6.60 + RelativePath="..\..\include\SDL_hints.h"
6.61 + >
6.62 + </File>
6.63 + <File
6.64 + RelativePath="..\..\include\SDL_input.h"
6.65 + >
6.66 + </File>
6.67 + <File
6.68 + RelativePath="..\..\include\SDL_joystick.h"
6.69 + >
6.70 + </File>
6.71 + <File
6.72 RelativePath="..\..\src\joystick\SDL_joystick_c.h"
6.73 >
6.74 </File>
6.75 <File
6.76 + RelativePath="..\..\include\SDL_keyboard.h"
6.77 + >
6.78 + </File>
6.79 + <File
6.80 RelativePath="..\..\src\events\SDL_keyboard_c.h"
6.81 >
6.82 </File>
6.83 <File
6.84 + RelativePath="..\..\include\SDL_keysym.h"
6.85 + >
6.86 + </File>
6.87 + <File
6.88 RelativePath="..\..\src\video\SDL_leaks.h"
6.89 >
6.90 </File>
6.91 <File
6.92 + RelativePath="..\..\include\SDL_loadso.h"
6.93 + >
6.94 + </File>
6.95 + <File
6.96 + RelativePath="..\..\include\SDL_log.h"
6.97 + >
6.98 + </File>
6.99 + <File
6.100 RelativePath="..\..\src\events\SDL_mouse_c.h"
6.101 >
6.102 </File>
6.103 @@ -1271,6 +1299,10 @@
6.104 >
6.105 </File>
6.106 <File
6.107 + RelativePath="..\..\src\render\software\SDL_render_sw_c.h"
6.108 + >
6.109 + </File>
6.110 + <File
6.111 RelativePath="..\..\src\render\software\SDL_renderer_sw_c.h"
6.112 >
6.113 </File>
6.114 @@ -1359,10 +1391,6 @@
6.115 >
6.116 </File>
6.117 <File
6.118 - RelativePath="..\..\src\video\windows\SDL_windowsgamma.h"
6.119 - >
6.120 - </File>
6.121 - <File
6.122 RelativePath="..\..\src\video\windows\SDL_windowskeyboard.h"
6.123 >
6.124 </File>
7.1 --- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Sun Feb 06 23:48:31 2011 -0800
7.2 +++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Sat Feb 12 19:16:09 2011 -0800
7.3 @@ -76,7 +76,7 @@
7.4 0402A85812FE70C600CECEE3 /* SDL_render_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0402A85512FE70C600CECEE3 /* SDL_render_gles2.c */; };
7.5 0402A85912FE70C600CECEE3 /* SDL_shaders_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0402A85612FE70C600CECEE3 /* SDL_shaders_gles2.c */; };
7.6 0402A85A12FE70C600CECEE3 /* SDL_shaders_gles2.h in Headers */ = {isa = PBXBuildFile; fileRef = 0402A85712FE70C600CECEE3 /* SDL_shaders_gles2.h */; };
7.7 - 04043B8D12FEA9350076DB1F /* SDL_opengles2.h in Headers */ = {isa = PBXBuildFile; fileRef = 04043B8C12FEA9350076DB1F /* SDL_opengles2.h */; };
7.8 + 04043B8D12FEA9350076DB1F /* SDL_opengles2.h in Headers */ = {isa = PBXBuildFile; fileRef = 04043B8C12FEA9350076DB1F /* SDL_opengles2.h */; settings = {ATTRIBUTES = (Public, ); }; };
7.9 041B2CD912FA0E9E0087D585 /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2CD812FA0E9E0087D585 /* SDL_render.h */; settings = {ATTRIBUTES = (Public, ); }; };
7.10 041B2CF112FA0F680087D585 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CEA12FA0F680087D585 /* SDL_render.c */; };
7.11 041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2CEB12FA0F680087D585 /* SDL_sysrender.h */; };
7.12 @@ -86,7 +86,7 @@
7.13 04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */; };
7.14 04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */; };
7.15 04409BA912FA989600FB9AA8 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */; };
7.16 - 0442EC4B12FE1BFF004C9285 /* SDL_hints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC4A12FE1BFF004C9285 /* SDL_hints.h */; };
7.17 + 0442EC4B12FE1BFF004C9285 /* SDL_hints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC4A12FE1BFF004C9285 /* SDL_hints.h */; settings = {ATTRIBUTES = (Public, ); }; };
7.18 0442EC5012FE1C1E004C9285 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC4E12FE1C1E004C9285 /* SDL_render_sw_c.h */; };
7.19 0442EC5112FE1C1E004C9285 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC4F12FE1C1E004C9285 /* SDL_render_sw.c */; };
7.20 0442EC5312FE1C28004C9285 /* SDL_render_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5212FE1C28004C9285 /* SDL_render_gles.c */; };
7.21 @@ -111,6 +111,9 @@
7.22 04BA9D6611EF474A00B60E01 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6211EF474A00B60E01 /* SDL_touch.c */; };
7.23 04BA9D7D11EF497E00B60E01 /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D7B11EF497E00B60E01 /* SDL_gesture.h */; settings = {ATTRIBUTES = (Public, ); }; };
7.24 04BA9D7E11EF497E00B60E01 /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D7C11EF497E00B60E01 /* SDL_touch.h */; settings = {ATTRIBUTES = (Public, ); }; };
7.25 + 04BAC0991300C0F70055DE28 /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BAC0981300C0F70055DE28 /* SDL_log.h */; settings = {ATTRIBUTES = (Public, ); }; };
7.26 + 04BAC09C1300C1290055DE28 /* SDL_assert_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BAC09A1300C1290055DE28 /* SDL_assert_c.h */; };
7.27 + 04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC09B1300C1290055DE28 /* SDL_log.c */; };
7.28 04EC8B521025D12900431D42 /* SDL_config_iphoneos.h in Headers */ = {isa = PBXBuildFile; fileRef = 04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */; settings = {ATTRIBUTES = (Public, ); }; };
7.29 04F2AF541104ABC300D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF531104ABC300D6DDF7 /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; };
7.30 04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */; };
7.31 @@ -235,8 +238,6 @@
7.32 FDA684560DF2374E00F98A1A /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683090DF2374E00F98A1A /* SDL_blit_N.c */; };
7.33 FDA684570DF2374E00F98A1A /* SDL_blit_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */; };
7.34 FDA684580DF2374E00F98A1A /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */; };
7.35 - FDA6845A0DF2374E00F98A1A /* SDL_gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830D0DF2374E00F98A1A /* SDL_gamma.c */; };
7.36 - FDA6845B0DF2374E00F98A1A /* SDL_leaks.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA6830E0DF2374E00F98A1A /* SDL_leaks.h */; };
7.37 FDA6845C0DF2374E00F98A1A /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */; };
7.38 FDA6845D0DF2374E00F98A1A /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */; };
7.39 FDA6845E0DF2374E00F98A1A /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683110DF2374E00F98A1A /* SDL_rect.c */; };
7.40 @@ -381,6 +382,9 @@
7.41 04BA9D6211EF474A00B60E01 /* SDL_touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_touch.c; sourceTree = "<group>"; };
7.42 04BA9D7B11EF497E00B60E01 /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_gesture.h; path = ../../include/SDL_gesture.h; sourceTree = SOURCE_ROOT; };
7.43 04BA9D7C11EF497E00B60E01 /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_touch.h; path = ../../include/SDL_touch.h; sourceTree = SOURCE_ROOT; };
7.44 + 04BAC0981300C0F70055DE28 /* SDL_log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_log.h; path = ../../include/SDL_log.h; sourceTree = SOURCE_ROOT; };
7.45 + 04BAC09A1300C1290055DE28 /* SDL_assert_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert_c.h; path = ../../src/SDL_assert_c.h; sourceTree = SOURCE_ROOT; };
7.46 + 04BAC09B1300C1290055DE28 /* SDL_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_log.c; path = ../../src/SDL_log.c; sourceTree = SOURCE_ROOT; };
7.47 04EC8B501025D12900431D42 /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_iphoneos.h; path = ../../include/SDL_config_iphoneos.h; sourceTree = SOURCE_ROOT; };
7.48 04F2AF531104ABC300D6DDF7 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert.h; path = ../../include/SDL_assert.h; sourceTree = SOURCE_ROOT; };
7.49 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_assert.c; path = ../../src/SDL_assert.c; sourceTree = SOURCE_ROOT; };
7.50 @@ -532,8 +536,6 @@
7.51 FDA683090DF2374E00F98A1A /* SDL_blit_N.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_N.c; sourceTree = "<group>"; };
7.52 FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_slow.c; sourceTree = "<group>"; };
7.53 FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_bmp.c; sourceTree = "<group>"; };
7.54 - FDA6830D0DF2374E00F98A1A /* SDL_gamma.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gamma.c; sourceTree = "<group>"; };
7.55 - FDA6830E0DF2374E00F98A1A /* SDL_leaks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_leaks.h; sourceTree = "<group>"; };
7.56 FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_pixels.c; sourceTree = "<group>"; };
7.57 FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels_c.h; sourceTree = "<group>"; };
7.58 FDA683110DF2374E00F98A1A /* SDL_rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rect.c; sourceTree = "<group>"; };
7.59 @@ -949,6 +951,7 @@
7.60 FD99B8DF0DD52EB400FB1D6B /* SDL_keyboard.h */,
7.61 FD99B8E00DD52EB400FB1D6B /* SDL_keysym.h */,
7.62 FD99B8E10DD52EB400FB1D6B /* SDL_loadso.h */,
7.63 + 04BAC0981300C0F70055DE28 /* SDL_log.h */,
7.64 FD99B8E20DD52EB400FB1D6B /* SDL_main.h */,
7.65 FD99B8E30DD52EB400FB1D6B /* SDL_mouse.h */,
7.66 FD99B8E40DD52EB400FB1D6B /* SDL_mutex.h */,
7.67 @@ -997,12 +1000,14 @@
7.68 FD99BA1E0DD52EDC00FB1D6B /* timer */,
7.69 FDA682420DF2374D00F98A1A /* video */,
7.70 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */,
7.71 + 04BAC09A1300C1290055DE28 /* SDL_assert_c.h */,
7.72 FD99B9D30DD52EDC00FB1D6B /* SDL_compat.c */,
7.73 FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */,
7.74 FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */,
7.75 FD99B9D60DD52EDC00FB1D6B /* SDL_fatal.c */,
7.76 FD99B9D70DD52EDC00FB1D6B /* SDL_fatal.h */,
7.77 0442EC5412FE1C3F004C9285 /* SDL_hints.c */,
7.78 + 04BAC09B1300C1290055DE28 /* SDL_log.c */,
7.79 FD99B9D80DD52EDC00FB1D6B /* SDL.c */,
7.80 );
7.81 name = "Library Source";
7.82 @@ -1154,8 +1159,6 @@
7.83 FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */,
7.84 044E5FB711E606EB0076F181 /* SDL_clipboard.c */,
7.85 0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */,
7.86 - FDA6830D0DF2374E00F98A1A /* SDL_gamma.c */,
7.87 - FDA6830E0DF2374E00F98A1A /* SDL_leaks.h */,
7.88 FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */,
7.89 FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */,
7.90 FDA683110DF2374E00F98A1A /* SDL_rect.c */,
7.91 @@ -1226,7 +1229,6 @@
7.92 FDA6844E0DF2374E00F98A1A /* SDL_blit.h in Headers */,
7.93 FDA684530DF2374E00F98A1A /* SDL_blit_auto.h in Headers */,
7.94 FDA684550DF2374E00F98A1A /* SDL_blit_copy.h in Headers */,
7.95 - FDA6845B0DF2374E00F98A1A /* SDL_leaks.h in Headers */,
7.96 FDA6845D0DF2374E00F98A1A /* SDL_pixels_c.h in Headers */,
7.97 FDA684630DF2374E00F98A1A /* SDL_RLEaccel_c.h in Headers */,
7.98 FDA684670DF2374E00F98A1A /* SDL_sysvideo.h in Headers */,
7.99 @@ -1279,6 +1281,8 @@
7.100 0442EC5012FE1C1E004C9285 /* SDL_render_sw_c.h in Headers */,
7.101 0402A85A12FE70C600CECEE3 /* SDL_shaders_gles2.h in Headers */,
7.102 04043B8D12FEA9350076DB1F /* SDL_opengles2.h in Headers */,
7.103 + 04BAC0991300C0F70055DE28 /* SDL_log.h in Headers */,
7.104 + 04BAC09C1300C1290055DE28 /* SDL_assert_c.h in Headers */,
7.105 );
7.106 runOnlyForDeploymentPostprocessing = 0;
7.107 };
7.108 @@ -1495,7 +1499,6 @@
7.109 FDA684560DF2374E00F98A1A /* SDL_blit_N.c in Sources */,
7.110 FDA684570DF2374E00F98A1A /* SDL_blit_slow.c in Sources */,
7.111 FDA684580DF2374E00F98A1A /* SDL_bmp.c in Sources */,
7.112 - FDA6845A0DF2374E00F98A1A /* SDL_gamma.c in Sources */,
7.113 FDA6845C0DF2374E00F98A1A /* SDL_pixels.c in Sources */,
7.114 FDA6845E0DF2374E00F98A1A /* SDL_rect.c in Sources */,
7.115 FDA684620DF2374E00F98A1A /* SDL_RLEaccel.c in Sources */,
7.116 @@ -1545,6 +1548,7 @@
7.117 0442EC5512FE1C3F004C9285 /* SDL_hints.c in Sources */,
7.118 0402A85812FE70C600CECEE3 /* SDL_render_gles2.c in Sources */,
7.119 0402A85912FE70C600CECEE3 /* SDL_shaders_gles2.c in Sources */,
7.120 + 04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */,
7.121 );
7.122 runOnlyForDeploymentPostprocessing = 0;
7.123 };
8.1 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj Sun Feb 06 23:48:31 2011 -0800
8.2 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj Sat Feb 12 19:16:09 2011 -0800
8.3 @@ -129,6 +129,10 @@
8.4 041B2CA612FA0D680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */; };
8.5 041B2CAB12FA0D680087D585 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9E12FA0D680087D585 /* SDL_render.c */; };
8.6 041B2CAC12FA0D680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */; };
8.7 + 0435673E1303160F00BA5428 /* SDL_shaders_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */; };
8.8 + 0435673F1303160F00BA5428 /* SDL_shaders_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */; };
8.9 + 043567401303160F00BA5428 /* SDL_shaders_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */; };
8.10 + 043567411303160F00BA5428 /* SDL_shaders_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */; };
8.11 04409B9112FA97ED00FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8D12FA97ED00FB9AA8 /* mmx.h */; };
8.12 04409B9212FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */; };
8.13 04409B9312FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */; };
8.14 @@ -155,6 +159,10 @@
8.15 044E5F8611E6051C0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5F8411E6051C0076F181 /* SDL_clipboard.h */; };
8.16 0469A10B12EE4BF100B846D6 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10912EE4BF100B846D6 /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; };
8.17 0469A10D12EE4BF100B846D6 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10912EE4BF100B846D6 /* SDL_blendmode.h */; };
8.18 + 04BAC0B31300C1CB0055DE28 /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BAC0B21300C1CB0055DE28 /* SDL_log.h */; settings = {ATTRIBUTES = (Public, ); }; };
8.19 + 04BAC0B41300C1CB0055DE28 /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BAC0B21300C1CB0055DE28 /* SDL_log.h */; };
8.20 + 04BAC0C81300C2160055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC0C71300C2160055DE28 /* SDL_log.c */; };
8.21 + 04BAC0C91300C2160055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC0C71300C2160055DE28 /* SDL_log.c */; };
8.22 04BD000812E6671800899322 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; };
8.23 04BD000912E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; };
8.24 04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; };
8.25 @@ -279,8 +287,6 @@
8.26 04BD018112E6671800899322 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; };
8.27 04BD018212E6671800899322 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; };
8.28 04BD018712E6671800899322 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; };
8.29 - 04BD018812E6671800899322 /* SDL_gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6112E6671800899322 /* SDL_gamma.c */; };
8.30 - 04BD018B12E6671800899322 /* SDL_leaks.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6412E6671800899322 /* SDL_leaks.h */; };
8.31 04BD018C12E6671800899322 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6512E6671800899322 /* SDL_pixels.c */; };
8.32 04BD018D12E6671800899322 /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6612E6671800899322 /* SDL_pixels_c.h */; };
8.33 04BD018E12E6671800899322 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6712E6671800899322 /* SDL_rect.c */; };
8.34 @@ -300,8 +306,6 @@
8.35 04BD01E012E6671800899322 /* SDL_x11dyn.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBD12E6671800899322 /* SDL_x11dyn.h */; };
8.36 04BD01E112E6671800899322 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBE12E6671800899322 /* SDL_x11events.c */; };
8.37 04BD01E212E6671800899322 /* SDL_x11events.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBF12E6671800899322 /* SDL_x11events.h */; };
8.38 - 04BD01E312E6671800899322 /* SDL_x11gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC012E6671800899322 /* SDL_x11gamma.c */; };
8.39 - 04BD01E412E6671800899322 /* SDL_x11gamma.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC112E6671800899322 /* SDL_x11gamma.h */; };
8.40 04BD01E512E6671800899322 /* SDL_x11keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */; };
8.41 04BD01E612E6671800899322 /* SDL_x11keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */; };
8.42 04BD01E712E6671800899322 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC412E6671800899322 /* SDL_x11modes.c */; };
8.43 @@ -467,8 +471,6 @@
8.44 04BD039B12E6671800899322 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; };
8.45 04BD039C12E6671800899322 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; };
8.46 04BD03A112E6671800899322 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; };
8.47 - 04BD03A212E6671800899322 /* SDL_gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6112E6671800899322 /* SDL_gamma.c */; };
8.48 - 04BD03A512E6671800899322 /* SDL_leaks.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6412E6671800899322 /* SDL_leaks.h */; };
8.49 04BD03A612E6671800899322 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6512E6671800899322 /* SDL_pixels.c */; };
8.50 04BD03A712E6671800899322 /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6612E6671800899322 /* SDL_pixels_c.h */; };
8.51 04BD03A812E6671800899322 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6712E6671800899322 /* SDL_rect.c */; };
8.52 @@ -488,8 +490,6 @@
8.53 04BD03F812E6671800899322 /* SDL_x11dyn.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBD12E6671800899322 /* SDL_x11dyn.h */; };
8.54 04BD03F912E6671800899322 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBE12E6671800899322 /* SDL_x11events.c */; };
8.55 04BD03FA12E6671800899322 /* SDL_x11events.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBF12E6671800899322 /* SDL_x11events.h */; };
8.56 - 04BD03FB12E6671800899322 /* SDL_x11gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC012E6671800899322 /* SDL_x11gamma.c */; };
8.57 - 04BD03FC12E6671800899322 /* SDL_x11gamma.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC112E6671800899322 /* SDL_x11gamma.h */; };
8.58 04BD03FD12E6671800899322 /* SDL_x11keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */; };
8.59 04BD03FE12E6671800899322 /* SDL_x11keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */; };
8.60 04BD03FF12E6671800899322 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC412E6671800899322 /* SDL_x11modes.c */; };
8.61 @@ -696,6 +696,8 @@
8.62 041B2C9412FA0D2A0087D585 /* SDL_render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_render.h; path = ../../include/SDL_render.h; sourceTree = SOURCE_ROOT; };
8.63 041B2C9E12FA0D680087D585 /* SDL_render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render.c; sourceTree = "<group>"; };
8.64 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysrender.h; sourceTree = "<group>"; };
8.65 + 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shaders_gl.c; sourceTree = "<group>"; };
8.66 + 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shaders_gl.h; sourceTree = "<group>"; };
8.67 04409B8D12FA97ED00FB9AA8 /* mmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmx.h; sourceTree = "<group>"; };
8.68 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = "<group>"; };
8.69 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_sw_c.h; sourceTree = "<group>"; };
8.70 @@ -709,6 +711,8 @@
8.71 0442EC5E12FE1C75004C9285 /* SDL_hints.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_hints.c; path = ../../src/SDL_hints.c; sourceTree = SOURCE_ROOT; };
8.72 044E5F8411E6051C0076F181 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_clipboard.h; path = ../../include/SDL_clipboard.h; sourceTree = SOURCE_ROOT; };
8.73 0469A10912EE4BF100B846D6 /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_blendmode.h; path = ../../include/SDL_blendmode.h; sourceTree = SOURCE_ROOT; };
8.74 + 04BAC0B21300C1CB0055DE28 /* SDL_log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_log.h; path = ../../include/SDL_log.h; sourceTree = SOURCE_ROOT; };
8.75 + 04BAC0C71300C2160055DE28 /* SDL_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_log.c; path = ../../src/SDL_log.c; sourceTree = SOURCE_ROOT; };
8.76 04BDFD7412E6671700899322 /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = "<group>"; };
8.77 04BDFD7512E6671700899322 /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = "<group>"; };
8.78 04BDFD8812E6671700899322 /* SDL_diskaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_diskaudio.c; sourceTree = "<group>"; };
8.79 @@ -835,8 +839,6 @@
8.80 04BDFF5A12E6671800899322 /* SDL_bmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_bmp.c; sourceTree = "<group>"; };
8.81 04BDFF5B12E6671800899322 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = "<group>"; };
8.82 04BDFF6012E6671800899322 /* SDL_fillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_fillrect.c; sourceTree = "<group>"; };
8.83 - 04BDFF6112E6671800899322 /* SDL_gamma.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gamma.c; sourceTree = "<group>"; };
8.84 - 04BDFF6412E6671800899322 /* SDL_leaks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_leaks.h; sourceTree = "<group>"; };
8.85 04BDFF6512E6671800899322 /* SDL_pixels.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_pixels.c; sourceTree = "<group>"; };
8.86 04BDFF6612E6671800899322 /* SDL_pixels_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels_c.h; sourceTree = "<group>"; };
8.87 04BDFF6712E6671800899322 /* SDL_rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rect.c; sourceTree = "<group>"; };
8.88 @@ -856,8 +858,6 @@
8.89 04BDFFBD12E6671800899322 /* SDL_x11dyn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11dyn.h; sourceTree = "<group>"; };
8.90 04BDFFBE12E6671800899322 /* SDL_x11events.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11events.c; sourceTree = "<group>"; };
8.91 04BDFFBF12E6671800899322 /* SDL_x11events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11events.h; sourceTree = "<group>"; };
8.92 - 04BDFFC012E6671800899322 /* SDL_x11gamma.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11gamma.c; sourceTree = "<group>"; };
8.93 - 04BDFFC112E6671800899322 /* SDL_x11gamma.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11gamma.h; sourceTree = "<group>"; };
8.94 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11keyboard.c; sourceTree = "<group>"; };
8.95 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11keyboard.h; sourceTree = "<group>"; };
8.96 04BDFFC412E6671800899322 /* SDL_x11modes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11modes.c; sourceTree = "<group>"; };
8.97 @@ -1137,6 +1137,7 @@
8.98 0C5AF5F101191D2B7F000001 /* SDL_keyboard.h */,
8.99 0C5AF5F201191D2B7F000001 /* SDL_keysym.h */,
8.100 B29A290D04E5B28700A80002 /* SDL_loadso.h */,
8.101 + 04BAC0B21300C1CB0055DE28 /* SDL_log.h */,
8.102 0C5AF5F301191D2B7F000001 /* SDL_main.h */,
8.103 0C5AF5F401191D2B7F000001 /* SDL_mouse.h */,
8.104 0C5AF5F501191D2B7F000001 /* SDL_mutex.h */,
8.105 @@ -1199,6 +1200,8 @@
8.106 children = (
8.107 04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */,
8.108 0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */,
8.109 + 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */,
8.110 + 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */,
8.111 );
8.112 path = opengl;
8.113 sourceTree = "<group>";
8.114 @@ -1510,8 +1513,6 @@
8.115 04BDFF5A12E6671800899322 /* SDL_bmp.c */,
8.116 04BDFF5B12E6671800899322 /* SDL_clipboard.c */,
8.117 04BDFF6012E6671800899322 /* SDL_fillrect.c */,
8.118 - 04BDFF6112E6671800899322 /* SDL_gamma.c */,
8.119 - 04BDFF6412E6671800899322 /* SDL_leaks.h */,
8.120 04BDFF6512E6671800899322 /* SDL_pixels.c */,
8.121 04BDFF6612E6671800899322 /* SDL_pixels_c.h */,
8.122 04BDFF6712E6671800899322 /* SDL_rect.c */,
8.123 @@ -1579,8 +1580,6 @@
8.124 04BDFFBF12E6671800899322 /* SDL_x11events.h */,
8.125 0442EC5812FE1C60004C9285 /* SDL_x11framebuffer.c */,
8.126 0442EC5912FE1C60004C9285 /* SDL_x11framebuffer.h */,
8.127 - 04BDFFC012E6671800899322 /* SDL_x11gamma.c */,
8.128 - 04BDFFC112E6671800899322 /* SDL_x11gamma.h */,
8.129 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */,
8.130 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */,
8.131 04BDFFC412E6671800899322 /* SDL_x11modes.c */,
8.132 @@ -1722,6 +1721,7 @@
8.133 04BDFE5A12E6671700899322 /* SDL_fatal.c */,
8.134 04BDFE5B12E6671700899322 /* SDL_fatal.h */,
8.135 0442EC5E12FE1C75004C9285 /* SDL_hints.c */,
8.136 + 04BAC0C71300C2160055DE28 /* SDL_log.c */,
8.137 04BDFE5C12E6671700899322 /* SDL.c */,
8.138 );
8.139 name = "Library Source";
8.140 @@ -1881,7 +1881,6 @@
8.141 04BD017B12E6671800899322 /* SDL_blit_auto.h in Headers */,
8.142 04BD017D12E6671800899322 /* SDL_blit_copy.h in Headers */,
8.143 04BD018012E6671800899322 /* SDL_blit_slow.h in Headers */,
8.144 - 04BD018B12E6671800899322 /* SDL_leaks.h in Headers */,
8.145 04BD018D12E6671800899322 /* SDL_pixels_c.h in Headers */,
8.146 04BD019712E6671800899322 /* SDL_RLEaccel_c.h in Headers */,
8.147 04BD019912E6671800899322 /* SDL_shape_internals.h in Headers */,
8.148 @@ -1890,7 +1889,6 @@
8.149 04BD01DE12E6671800899322 /* SDL_x11clipboard.h in Headers */,
8.150 04BD01E012E6671800899322 /* SDL_x11dyn.h in Headers */,
8.151 04BD01E212E6671800899322 /* SDL_x11events.h in Headers */,
8.152 - 04BD01E412E6671800899322 /* SDL_x11gamma.h in Headers */,
8.153 04BD01E612E6671800899322 /* SDL_x11keyboard.h in Headers */,
8.154 04BD01E812E6671800899322 /* SDL_x11modes.h in Headers */,
8.155 04BD01EA12E6671800899322 /* SDL_x11mouse.h in Headers */,
8.156 @@ -1932,6 +1930,8 @@
8.157 0442EC1C12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */,
8.158 0442EC5B12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */,
8.159 04043BBB12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */,
8.160 + 04BAC0B31300C1CB0055DE28 /* SDL_log.h in Headers */,
8.161 + 0435673F1303160F00BA5428 /* SDL_shaders_gl.h in Headers */,
8.162 );
8.163 runOnlyForDeploymentPostprocessing = 0;
8.164 };
8.165 @@ -2010,7 +2010,6 @@
8.166 04BD039512E6671800899322 /* SDL_blit_auto.h in Headers */,
8.167 04BD039712E6671800899322 /* SDL_blit_copy.h in Headers */,
8.168 04BD039A12E6671800899322 /* SDL_blit_slow.h in Headers */,
8.169 - 04BD03A512E6671800899322 /* SDL_leaks.h in Headers */,
8.170 04BD03A712E6671800899322 /* SDL_pixels_c.h in Headers */,
8.171 04BD03B112E6671800899322 /* SDL_RLEaccel_c.h in Headers */,
8.172 04BD03B312E6671800899322 /* SDL_shape_internals.h in Headers */,
8.173 @@ -2019,7 +2018,6 @@
8.174 04BD03F612E6671800899322 /* SDL_x11clipboard.h in Headers */,
8.175 04BD03F812E6671800899322 /* SDL_x11dyn.h in Headers */,
8.176 04BD03FA12E6671800899322 /* SDL_x11events.h in Headers */,
8.177 - 04BD03FC12E6671800899322 /* SDL_x11gamma.h in Headers */,
8.178 04BD03FE12E6671800899322 /* SDL_x11keyboard.h in Headers */,
8.179 04BD040012E6671800899322 /* SDL_x11modes.h in Headers */,
8.180 04BD040212E6671800899322 /* SDL_x11mouse.h in Headers */,
8.181 @@ -2061,6 +2059,8 @@
8.182 0442EC1E12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */,
8.183 0442EC5D12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */,
8.184 04043BBC12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */,
8.185 + 04BAC0B41300C1CB0055DE28 /* SDL_log.h in Headers */,
8.186 + 043567411303160F00BA5428 /* SDL_shaders_gl.h in Headers */,
8.187 );
8.188 runOnlyForDeploymentPostprocessing = 0;
8.189 };
8.190 @@ -2392,7 +2392,6 @@
8.191 04BD018112E6671800899322 /* SDL_bmp.c in Sources */,
8.192 04BD018212E6671800899322 /* SDL_clipboard.c in Sources */,
8.193 04BD018712E6671800899322 /* SDL_fillrect.c in Sources */,
8.194 - 04BD018812E6671800899322 /* SDL_gamma.c in Sources */,
8.195 04BD018C12E6671800899322 /* SDL_pixels.c in Sources */,
8.196 04BD018E12E6671800899322 /* SDL_rect.c in Sources */,
8.197 04BD019612E6671800899322 /* SDL_RLEaccel.c in Sources */,
8.198 @@ -2404,7 +2403,6 @@
8.199 04BD01DD12E6671800899322 /* SDL_x11clipboard.c in Sources */,
8.200 04BD01DF12E6671800899322 /* SDL_x11dyn.c in Sources */,
8.201 04BD01E112E6671800899322 /* SDL_x11events.c in Sources */,
8.202 - 04BD01E312E6671800899322 /* SDL_x11gamma.c in Sources */,
8.203 04BD01E512E6671800899322 /* SDL_x11keyboard.c in Sources */,
8.204 04BD01E712E6671800899322 /* SDL_x11modes.c in Sources */,
8.205 04BD01E912E6671800899322 /* SDL_x11mouse.c in Sources */,
8.206 @@ -2431,6 +2429,8 @@
8.207 0442EC1D12FE1BCB004C9285 /* SDL_render_sw.c in Sources */,
8.208 0442EC5A12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */,
8.209 0442EC5F12FE1C75004C9285 /* SDL_hints.c in Sources */,
8.210 + 04BAC0C81300C2160055DE28 /* SDL_log.c in Sources */,
8.211 + 0435673E1303160F00BA5428 /* SDL_shaders_gl.c in Sources */,
8.212 );
8.213 runOnlyForDeploymentPostprocessing = 0;
8.214 };
8.215 @@ -2511,7 +2511,6 @@
8.216 04BD039B12E6671800899322 /* SDL_bmp.c in Sources */,
8.217 04BD039C12E6671800899322 /* SDL_clipboard.c in Sources */,
8.218 04BD03A112E6671800899322 /* SDL_fillrect.c in Sources */,
8.219 - 04BD03A212E6671800899322 /* SDL_gamma.c in Sources */,
8.220 04BD03A612E6671800899322 /* SDL_pixels.c in Sources */,
8.221 04BD03A812E6671800899322 /* SDL_rect.c in Sources */,
8.222 04BD03B012E6671800899322 /* SDL_RLEaccel.c in Sources */,
8.223 @@ -2523,7 +2522,6 @@
8.224 04BD03F512E6671800899322 /* SDL_x11clipboard.c in Sources */,
8.225 04BD03F712E6671800899322 /* SDL_x11dyn.c in Sources */,
8.226 04BD03F912E6671800899322 /* SDL_x11events.c in Sources */,
8.227 - 04BD03FB12E6671800899322 /* SDL_x11gamma.c in Sources */,
8.228 04BD03FD12E6671800899322 /* SDL_x11keyboard.c in Sources */,
8.229 04BD03FF12E6671800899322 /* SDL_x11modes.c in Sources */,
8.230 04BD040112E6671800899322 /* SDL_x11mouse.c in Sources */,
8.231 @@ -2550,6 +2548,8 @@
8.232 0442EC1F12FE1BCB004C9285 /* SDL_render_sw.c in Sources */,
8.233 0442EC5C12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */,
8.234 0442EC6012FE1C75004C9285 /* SDL_hints.c in Sources */,
8.235 + 04BAC0C91300C2160055DE28 /* SDL_log.c in Sources */,
8.236 + 043567401303160F00BA5428 /* SDL_shaders_gl.c in Sources */,
8.237 );
8.238 runOnlyForDeploymentPostprocessing = 0;
8.239 };
9.1 --- a/android-project/src/org/libsdl/app/SDLActivity.java Sun Feb 06 23:48:31 2011 -0800
9.2 +++ b/android-project/src/org/libsdl/app/SDLActivity.java Sat Feb 12 19:16:09 2011 -0800
9.3 @@ -101,8 +101,8 @@
9.4
9.5 // Java functions called from C
9.6
9.7 - public static void createGLContext() {
9.8 - mSurface.initEGL();
9.9 + public static boolean createGLContext(int majorVersion, int minorVersion) {
9.10 + return mSurface.initEGL(majorVersion, minorVersion);
9.11 }
9.12
9.13 public static void flipBuffers() {
9.14 @@ -351,11 +351,10 @@
9.15
9.16
9.17 // EGL functions
9.18 - public boolean initEGL() {
9.19 - Log.v("SDL", "Starting up");
9.20 + public boolean initEGL(int majorVersion, int minorVersion) {
9.21 + Log.v("SDL", "Starting up OpenGL ES " + majorVersion + "." + minorVersion);
9.22
9.23 try {
9.24 -
9.25 EGL10 egl = (EGL10)EGLContext.getEGL();
9.26
9.27 EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
9.28 @@ -363,20 +362,43 @@
9.29 int[] version = new int[2];
9.30 egl.eglInitialize(dpy, version);
9.31
9.32 + int EGL_OPENGL_ES_BIT = 1;
9.33 + int EGL_OPENGL_ES2_BIT = 4;
9.34 + int renderableType = 0;
9.35 + if (majorVersion == 2) {
9.36 + renderableType = EGL_OPENGL_ES2_BIT;
9.37 + } else if (majorVersion == 1) {
9.38 + renderableType = EGL_OPENGL_ES_BIT;
9.39 + }
9.40 int[] configSpec = {
9.41 - //EGL10.EGL_DEPTH_SIZE, 16,
9.42 - EGL10.EGL_NONE
9.43 + //EGL10.EGL_DEPTH_SIZE, 16,
9.44 + EGL10.EGL_RENDERABLE_TYPE, renderableType,
9.45 + EGL10.EGL_NONE
9.46 };
9.47 EGLConfig[] configs = new EGLConfig[1];
9.48 int[] num_config = new int[1];
9.49 - egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config);
9.50 + if (!egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config) || num_config[0] == 0) {
9.51 + Log.e("SDL", "No EGL config available");
9.52 + return false;
9.53 + }
9.54 EGLConfig config = configs[0];
9.55
9.56 EGLContext ctx = egl.eglCreateContext(dpy, config, EGL10.EGL_NO_CONTEXT, null);
9.57 + if (ctx == EGL10.EGL_NO_CONTEXT) {
9.58 + Log.e("SDL", "Couldn't create context");
9.59 + return false;
9.60 + }
9.61
9.62 EGLSurface surface = egl.eglCreateWindowSurface(dpy, config, this, null);
9.63 + if (surface == EGL10.EGL_NO_SURFACE) {
9.64 + Log.e("SDL", "Couldn't create surface");
9.65 + return false;
9.66 + }
9.67
9.68 - egl.eglMakeCurrent(dpy, surface, surface, ctx);
9.69 + if (!egl.eglMakeCurrent(dpy, surface, surface, ctx)) {
9.70 + Log.e("SDL", "Couldn't make context current");
9.71 + return false;
9.72 + }
9.73
9.74 mEGLContext = ctx;
9.75 mEGLDisplay = dpy;
10.1 --- a/configure.in Sun Feb 06 23:48:31 2011 -0800
10.2 +++ b/configure.in Sat Feb 12 19:16:09 2011 -0800
10.3 @@ -362,6 +362,12 @@
10.4 if test x$enable_video != xyes; then
10.5 AC_DEFINE(SDL_VIDEO_DISABLED)
10.6 fi
10.7 +AC_ARG_ENABLE(render,
10.8 +AC_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
10.9 + , enable_render=yes)
10.10 +if test x$enable_render != xyes; then
10.11 + AC_DEFINE(SDL_RENDER_DISABLED)
10.12 +fi
10.13 AC_ARG_ENABLE(events,
10.14 AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
10.15 , enable_events=yes)
10.16 @@ -422,6 +428,12 @@
10.17 if test x$enable_cpuinfo != xyes; then
10.18 AC_DEFINE(SDL_CPUINFO_DISABLED)
10.19 fi
10.20 +AC_ARG_ENABLE(atomic,
10.21 +AC_HELP_STRING([--enable-atomic], [Enable the atomic operations [[default=yes]]]),
10.22 + , enable_atomic=yes)
10.23 +if test x$enable_atomic != xyes; then
10.24 + AC_DEFINE(SDL_ATOMIC_DISABLED)
10.25 +fi
10.26 AC_ARG_ENABLE(assembly,
10.27 AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
10.28 , enable_assembly=yes)
10.29 @@ -489,33 +501,6 @@
10.30 fi
10.31 fi
10.32
10.33 - AC_ARG_ENABLE(3dnow,
10.34 -AC_HELP_STRING([--enable-3dnow], [use MMX assembly routines [[default=yes]]]),
10.35 - , enable_3dnow=yes)
10.36 - if test x$enable_3dnow = xyes; then
10.37 - save_CFLAGS="$CFLAGS"
10.38 - have_gcc_3dnow=no
10.39 - AC_MSG_CHECKING(for GCC -m3dnow option)
10.40 - amd3dnow_CFLAGS="-m3dnow"
10.41 - CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
10.42 -
10.43 - AC_TRY_COMPILE([
10.44 - #include <mm3dnow.h>
10.45 - #ifndef __3dNOW__
10.46 - #error Assembler CPP flag not enabled
10.47 - #endif
10.48 - ],[
10.49 - ],[
10.50 - have_gcc_3dnow=yes
10.51 - ])
10.52 - AC_MSG_RESULT($have_gcc_3dnow)
10.53 - CFLAGS="$save_CFLAGS"
10.54 -
10.55 - if test x$have_gcc_3dnow = xyes; then
10.56 - EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
10.57 - fi
10.58 - fi
10.59 -
10.60 AC_ARG_ENABLE(sse,
10.61 AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
10.62 , enable_sse=yes)
10.63 @@ -587,82 +572,6 @@
10.64 EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
10.65 fi
10.66 fi
10.67 -
10.68 - AC_ARG_ENABLE(altivec,
10.69 -AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
10.70 - , enable_altivec=yes)
10.71 - if test x$enable_altivec = xyes; then
10.72 - save_CFLAGS="$CFLAGS"
10.73 - have_gcc_altivec=no
10.74 - have_altivec_h_hdr=no
10.75 - altivec_CFLAGS="-maltivec"
10.76 - CFLAGS="$save_CFLAGS $altivec_CFLAGS"
10.77 -
10.78 - AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
10.79 - AC_TRY_COMPILE([
10.80 - #include <altivec.h>
10.81 - vector unsigned int vzero() {
10.82 - return vec_splat_u32(0);
10.83 - }
10.84 - ],[
10.85 - ],[
10.86 - have_gcc_altivec=yes
10.87 - have_altivec_h_hdr=yes
10.88 - ])
10.89 - AC_MSG_RESULT($have_gcc_altivec)
10.90 -
10.91 - if test x$have_gcc_altivec = xno; then
10.92 - AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
10.93 - AC_TRY_COMPILE([
10.94 - vector unsigned int vzero() {
10.95 - return vec_splat_u32(0);
10.96 - }
10.97 - ],[
10.98 - ],[
10.99 - have_gcc_altivec=yes
10.100 - ])
10.101 - AC_MSG_RESULT($have_gcc_altivec)
10.102 - fi
10.103 -
10.104 - if test x$have_gcc_altivec = xno; then
10.105 - AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
10.106 - altivec_CFLAGS="-faltivec"
10.107 - CFLAGS="$save_CFLAGS $altivec_CFLAGS"
10.108 - AC_TRY_COMPILE([
10.109 - #include <altivec.h>
10.110 - vector unsigned int vzero() {
10.111 - return vec_splat_u32(0);
10.112 - }
10.113 - ],[
10.114 - ],[
10.115 - have_gcc_altivec=yes
10.116 - have_altivec_h_hdr=yes
10.117 - ])
10.118 - AC_MSG_RESULT($have_gcc_altivec)
10.119 - fi
10.120 -
10.121 - if test x$have_gcc_altivec = xno; then
10.122 - AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
10.123 - AC_TRY_COMPILE([
10.124 - vector unsigned int vzero() {
10.125 - return vec_splat_u32(0);
10.126 - }
10.127 - ],[
10.128 - ],[
10.129 - have_gcc_altivec=yes
10.130 - ])
10.131 - AC_MSG_RESULT($have_gcc_altivec)
10.132 - fi
10.133 - CFLAGS="$save_CFLAGS"
10.134 -
10.135 - if test x$have_gcc_altivec = xyes; then
10.136 - AC_DEFINE(SDL_ALTIVEC_BLITTERS)
10.137 - if test x$have_altivec_h_hdr = xyes; then
10.138 - AC_DEFINE(HAVE_ALTIVEC_H)
10.139 - fi
10.140 - EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
10.141 - fi
10.142 - fi
10.143 fi
10.144
10.145 dnl See if the OSS audio interface is supported
11.1 --- a/include/SDL.h Sun Feb 06 23:48:31 2011 -0800
11.2 +++ b/include/SDL.h Sat Feb 12 19:16:09 2011 -0800
11.3 @@ -1,6 +1,6 @@
11.4 /*
11.5 SDL - Simple DirectMedia Layer
11.6 - Copyright (C) 1997-2010 Sam Lantinga
11.7 + Copyright (C) 1997-2011 Sam Lantinga
11.8
11.9 This library is free software; you can redistribute it and/or
11.10 modify it under the terms of the GNU Lesser General Public
11.11 @@ -81,6 +81,7 @@
11.12 #include "SDL_events.h"
11.13 #include "SDL_hints.h"
11.14 #include "SDL_loadso.h"
11.15 +#include "SDL_log.h"
11.16 #include "SDL_mutex.h"
11.17 #include "SDL_power.h"
11.18 #include "SDL_render.h"
12.1 --- a/include/SDL_assert.h Sun Feb 06 23:48:31 2011 -0800
12.2 +++ b/include/SDL_assert.h Sat Feb 12 19:16:09 2011 -0800
12.3 @@ -1,6 +1,6 @@
12.4 /*
12.5 SDL - Simple DirectMedia Layer
12.6 - Copyright (C) 1997-2010 Sam Lantinga
12.7 + Copyright (C) 1997-2011 Sam Lantinga
12.8
12.9 This library is free software; you can redistribute it and/or
12.10 modify it under the terms of the GNU Lesser General Public
13.1 --- a/include/SDL_atomic.h Sun Feb 06 23:48:31 2011 -0800
13.2 +++ b/include/SDL_atomic.h Sat Feb 12 19:16:09 2011 -0800
13.3 @@ -1,6 +1,6 @@
13.4 /*
13.5 SDL - Simple DirectMedia Layer
13.6 - Copyright (C) 1997-2010 Sam Lantinga
13.7 + Copyright (C) 1997-2011 Sam Lantinga
13.8
13.9 This library is free software; you can redistribute it and/or
13.10 modify it under the terms of the GNU Lesser General Public
13.11 @@ -141,6 +141,9 @@
13.12 /* Platform specific optimized versions of the atomic functions,
13.13 * you can disable these by defining SDL_DISABLE_ATOMIC_INLINE
13.14 */
13.15 +#if SDL_ATOMIC_DISABLED
13.16 +#define SDL_DISABLE_ATOMIC_INLINE
13.17 +#endif
13.18 #ifndef SDL_DISABLE_ATOMIC_INLINE
13.19
13.20 #ifdef HAVE_MSC_ATOMICS
14.1 --- a/include/SDL_audio.h Sun Feb 06 23:48:31 2011 -0800
14.2 +++ b/include/SDL_audio.h Sat Feb 12 19:16:09 2011 -0800
14.3 @@ -1,6 +1,6 @@
14.4 /*
14.5 SDL - Simple DirectMedia Layer
14.6 - Copyright (C) 1997-2010 Sam Lantinga
14.7 + Copyright (C) 1997-2011 Sam Lantinga
14.8
14.9 This library is free software; you can redistribute it and/or
14.10 modify it under the terms of the GNU Lesser General Public
15.1 --- a/include/SDL_blendmode.h Sun Feb 06 23:48:31 2011 -0800
15.2 +++ b/include/SDL_blendmode.h Sat Feb 12 19:16:09 2011 -0800
15.3 @@ -1,6 +1,6 @@
15.4 /*
15.5 SDL - Simple DirectMedia Layer
15.6 - Copyright (C) 1997-2010 Sam Lantinga
15.7 + Copyright (C) 1997-2011 Sam Lantinga
15.8
15.9 This library is free software; you can redistribute it and/or
15.10 modify it under the terms of the GNU Lesser General Public
16.1 --- a/include/SDL_clipboard.h Sun Feb 06 23:48:31 2011 -0800
16.2 +++ b/include/SDL_clipboard.h Sat Feb 12 19:16:09 2011 -0800
16.3 @@ -1,6 +1,6 @@
16.4 /*
16.5 SDL - Simple DirectMedia Layer
16.6 - Copyright (C) 1997-2010 Sam Lantinga
16.7 + Copyright (C) 1997-2011 Sam Lantinga
16.8
16.9 This library is free software; you can redistribute it and/or
16.10 modify it under the terms of the GNU Lesser General Public
17.1 --- a/include/SDL_compat.h Sun Feb 06 23:48:31 2011 -0800
17.2 +++ b/include/SDL_compat.h Sat Feb 12 19:16:09 2011 -0800
17.3 @@ -1,6 +1,6 @@
17.4 /*
17.5 SDL - Simple DirectMedia Layer
17.6 - Copyright (C) 1997-2010 Sam Lantinga
17.7 + Copyright (C) 1997-2011 Sam Lantinga
17.8
17.9 This library is free software; you can redistribute it and/or
17.10 modify it under the terms of the GNU Lesser General Public
17.11 @@ -215,8 +215,12 @@
17.12 */
17.13 /*@{*/
17.14
17.15 -#define SDL_keysym SDL_KeySym
17.16 -#define SDL_scancode SDL_ScanCode
17.17 +#define SDL_keysym SDL_Keysym
17.18 +#define SDL_KeySym SDL_Keysym
17.19 +#define SDL_scancode SDL_Scancode
17.20 +#define SDL_ScanCode SDL_Scancode
17.21 +#define SDLKey SDL_Keycode
17.22 +#define SDLMod SDL_Keymod
17.23
17.24 /**
17.25 * \name Renamed keys
17.26 @@ -324,6 +328,12 @@
17.27 SDL_Rect * dstrect);
17.28 extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
17.29 extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
17.30 +extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
17.31 +extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red,
17.32 + const Uint16 * green,
17.33 + const Uint16 * blue);
17.34 +extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green,
17.35 + Uint16 * blue);
17.36 extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
17.37 extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
17.38 extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
18.1 --- a/include/SDL_config.h.default Sun Feb 06 23:48:31 2011 -0800
18.2 +++ b/include/SDL_config.h.default Sat Feb 12 19:16:09 2011 -0800
18.3 @@ -1,6 +1,6 @@
18.4 /*
18.5 SDL - Simple DirectMedia Layer
18.6 - Copyright (C) 1997-2009 Sam Lantinga
18.7 + Copyright (C) 1997-2011 Sam Lantinga
18.8
18.9 This library is free software; you can redistribute it and/or
18.10 modify it under the terms of the GNU Lesser General Public
19.1 --- a/include/SDL_config.h.in Sun Feb 06 23:48:31 2011 -0800
19.2 +++ b/include/SDL_config.h.in Sat Feb 12 19:16:09 2011 -0800
19.3 @@ -1,6 +1,6 @@
19.4 /*
19.5 SDL - Simple DirectMedia Layer
19.6 - Copyright (C) 1997-2009 Sam Lantinga
19.7 + Copyright (C) 1997-2011 Sam Lantinga
19.8
19.9 This library is free software; you can redistribute it and/or
19.10 modify it under the terms of the GNU Lesser General Public
19.11 @@ -82,7 +82,6 @@
19.12 #undef HAVE_MATH_H
19.13 #undef HAVE_ICONV_H
19.14 #undef HAVE_SIGNAL_H
19.15 -#undef HAVE_ALTIVEC_H
19.16
19.17 /* C library functions */
19.18 #undef HAVE_MALLOC
19.19 @@ -171,6 +170,7 @@
19.20 #undef SDL_DEFAULT_ASSERT_LEVEL
19.21
19.22 /* Allow disabling of core subsystems */
19.23 +#undef SDL_ATOMIC_DISABLED
19.24 #undef SDL_AUDIO_DISABLED
19.25 #undef SDL_CPUINFO_DISABLED
19.26 #undef SDL_EVENTS_DISABLED
19.27 @@ -178,6 +178,7 @@
19.28 #undef SDL_JOYSTICK_DISABLED
19.29 #undef SDL_HAPTIC_DISABLED
19.30 #undef SDL_LOADSO_DISABLED
19.31 +#undef SDL_RENDER_DISABLED
19.32 #undef SDL_THREADS_DISABLED
19.33 #undef SDL_TIMERS_DISABLED
19.34 #undef SDL_VIDEO_DISABLED
19.35 @@ -301,6 +302,5 @@
19.36
19.37 /* Enable assembly routines */
19.38 #undef SDL_ASSEMBLY_ROUTINES
19.39 -#undef SDL_ALTIVEC_BLITTERS
19.40
19.41 #endif /* _SDL_config_h */
20.1 --- a/include/SDL_config_android.h Sun Feb 06 23:48:31 2011 -0800
20.2 +++ b/include/SDL_config_android.h Sat Feb 12 19:16:09 2011 -0800
20.3 @@ -1,6 +1,6 @@
20.4 /*
20.5 SDL - Simple DirectMedia Layer
20.6 - Copyright (C) 1997-2010 Sam Lantinga
20.7 + Copyright (C) 1997-2011 Sam Lantinga
20.8
20.9 This library is free software; you can redistribute it and/or
20.10 modify it under the terms of the GNU Lesser General Public
21.1 --- a/include/SDL_config_iphoneos.h Sun Feb 06 23:48:31 2011 -0800
21.2 +++ b/include/SDL_config_iphoneos.h Sat Feb 12 19:16:09 2011 -0800
21.3 @@ -1,6 +1,6 @@
21.4 /*
21.5 SDL - Simple DirectMedia Layer
21.6 - Copyright (C) 1997-2010 Sam Lantinga
21.7 + Copyright (C) 1997-2011 Sam Lantinga
21.8
21.9 This library is free software; you can redistribute it and/or
21.10 modify it under the terms of the GNU Lesser General Public
22.1 --- a/include/SDL_config_macosx.h Sun Feb 06 23:48:31 2011 -0800
22.2 +++ b/include/SDL_config_macosx.h Sat Feb 12 19:16:09 2011 -0800
22.3 @@ -1,6 +1,6 @@
22.4 /*
22.5 SDL - Simple DirectMedia Layer
22.6 - Copyright (C) 1997-2010 Sam Lantinga
22.7 + Copyright (C) 1997-2011 Sam Lantinga
22.8
22.9 This library is free software; you can redistribute it and/or
22.10 modify it under the terms of the GNU Lesser General Public
22.11 @@ -168,8 +168,5 @@
22.12
22.13 /* Enable assembly routines */
22.14 #define SDL_ASSEMBLY_ROUTINES 1
22.15 -#ifdef __ppc__
22.16 -#define SDL_ALTIVEC_BLITTERS 1
22.17 -#endif
22.18
22.19 #endif /* _SDL_config_macosx_h */
23.1 --- a/include/SDL_config_minimal.h Sun Feb 06 23:48:31 2011 -0800
23.2 +++ b/include/SDL_config_minimal.h Sat Feb 12 19:16:09 2011 -0800
23.3 @@ -1,6 +1,6 @@
23.4 /*
23.5 SDL - Simple DirectMedia Layer
23.6 - Copyright (C) 1997-2010 Sam Lantinga
23.7 + Copyright (C) 1997-2011 Sam Lantinga
23.8
23.9 This library is free software; you can redistribute it and/or
23.10 modify it under the terms of the GNU Lesser General Public
24.1 --- a/include/SDL_config_nintendods.h Sun Feb 06 23:48:31 2011 -0800
24.2 +++ b/include/SDL_config_nintendods.h Sat Feb 12 19:16:09 2011 -0800
24.3 @@ -1,6 +1,6 @@
24.4 /*
24.5 SDL - Simple DirectMedia Layer
24.6 - Copyright (C) 1997-2010 Sam Lantinga
24.7 + Copyright (C) 1997-2011 Sam Lantinga
24.8
24.9 This library is free software; you can redistribute it and/or
24.10 modify it under the terms of the GNU Lesser General Public
24.11 @@ -46,6 +46,8 @@
24.12 #endif
24.13 #endif /* !_STDINT_H_ && !HAVE_STDINT_H */
24.14
24.15 +#define SIZEOF_VOIDP 4
24.16 +
24.17 #define SDL_HAS_64BIT_TYPE 1
24.18
24.19 /* Useful headers */
24.20 @@ -113,9 +115,12 @@
24.21
24.22 /* Enable various video drivers */
24.23 #define SDL_VIDEO_DRIVER_NDS 1
24.24 -/*#define SDL_VIDEO_DRIVER_DUMMY 1 TODO: uncomment this later*/
24.25 +#define SDL_VIDEO_RENDER_NDS 1
24.26
24.27 /* Enable system power support */
24.28 #define SDL_POWER_NINTENDODS 1
24.29
24.30 +/* Enable haptic support */
24.31 +#define SDL_HAPTIC_NDS 1
24.32 +
24.33 #endif /* _SDL_config_nintendods_h */
25.1 --- a/include/SDL_config_pandora.h Sun Feb 06 23:48:31 2011 -0800
25.2 +++ b/include/SDL_config_pandora.h Sat Feb 12 19:16:09 2011 -0800
25.3 @@ -1,6 +1,6 @@
25.4 /*
25.5 SDL - Simple DirectMedia Layer
25.6 - Copyright (C) 1997-2010 Sam Lantinga
25.7 + Copyright (C) 1997-2011 Sam Lantinga
25.8
25.9 This library is free software; you can redistribute it and/or
25.10 modify it under the terms of the GNU Lesser General Public
26.1 --- a/include/SDL_config_windows.h Sun Feb 06 23:48:31 2011 -0800
26.2 +++ b/include/SDL_config_windows.h Sat Feb 12 19:16:09 2011 -0800
26.3 @@ -1,6 +1,6 @@
26.4 /*
26.5 SDL - Simple DirectMedia Layer
26.6 - Copyright (C) 1997-2010 Sam Lantinga
26.7 + Copyright (C) 1997-2011 Sam Lantinga
26.8
26.9 This library is free software; you can redistribute it and/or
26.10 modify it under the terms of the GNU Lesser General Public
27.1 --- a/include/SDL_config_wiz.h Sun Feb 06 23:48:31 2011 -0800
27.2 +++ b/include/SDL_config_wiz.h Sat Feb 12 19:16:09 2011 -0800
27.3 @@ -1,6 +1,6 @@
27.4 /*
27.5 SDL - Simple DirectMedia Layer
27.6 - Copyright (C) 1997-2010 Sam Lantinga
27.7 + Copyright (C) 1997-2011 Sam Lantinga
27.8
27.9 This library is free software; you can redistribute it and/or
27.10 modify it under the terms of the GNU Lesser General Public
28.1 --- a/include/SDL_copying.h Sun Feb 06 23:48:31 2011 -0800
28.2 +++ b/include/SDL_copying.h Sat Feb 12 19:16:09 2011 -0800
28.3 @@ -1,6 +1,6 @@
28.4 /*
28.5 SDL - Simple DirectMedia Layer
28.6 - Copyright (C) 1997-2010 Sam Lantinga
28.7 + Copyright (C) 1997-2011 Sam Lantinga
28.8
28.9 This library is free software; you can redistribute it and/or
28.10 modify it under the terms of the GNU Lesser General Public
29.1 --- a/include/SDL_cpuinfo.h Sun Feb 06 23:48:31 2011 -0800
29.2 +++ b/include/SDL_cpuinfo.h Sat Feb 12 19:16:09 2011 -0800
29.3 @@ -1,6 +1,6 @@
29.4 /*
29.5 SDL - Simple DirectMedia Layer
29.6 - Copyright (C) 1997-2010 Sam Lantinga
29.7 + Copyright (C) 1997-2011 Sam Lantinga
29.8
29.9 This library is free software; you can redistribute it and/or
29.10 modify it under the terms of the GNU Lesser General Public
29.11 @@ -70,21 +70,6 @@
29.12 extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
29.13
29.14 /**
29.15 - * This function returns true if the CPU has MMX Ext.\ features.
29.16 - */
29.17 -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
29.18 -
29.19 -/**
29.20 - * This function returns true if the CPU has 3DNow!\ features.
29.21 - */
29.22 -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
29.23 -
29.24 -/**
29.25 - * This function returns true if the CPU has 3DNow!\ Ext.\ features.
29.26 - */
29.27 -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
29.28 -
29.29 -/**
29.30 * This function returns true if the CPU has SSE features.
29.31 */
29.32 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
29.33 @@ -95,9 +80,20 @@
29.34 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
29.35
29.36 /**
29.37 - * This function returns true if the CPU has AltiVec features.
29.38 + * This function returns true if the CPU has SSE3 features.
29.39 + */
29.40 +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
29.41 +
29.42 +/**
29.43 + * This function returns true if the CPU has SSE4.1 features.
29.44 */
29.45 -extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
29.46 +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
29.47 +
29.48 +/**
29.49 + * This function returns true if the CPU has SSE4.2 features.
29.50 + */
29.51 +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
29.52 +
29.53
29.54 /* Ends C function definitions when using C++ */
29.55 #ifdef __cplusplus
30.1 --- a/include/SDL_endian.h Sun Feb 06 23:48:31 2011 -0800
30.2 +++ b/include/SDL_endian.h Sat Feb 12 19:16:09 2011 -0800
30.3 @@ -1,6 +1,6 @@
30.4 /*
30.5 SDL - Simple DirectMedia Layer
30.6 - Copyright (C) 1997-2010 Sam Lantinga
30.7 + Copyright (C) 1997-2011 Sam Lantinga
30.8
30.9 This library is free software; you can redistribute it and/or
30.10 modify it under the terms of the GNU Lesser General Public
31.1 --- a/include/SDL_error.h Sun Feb 06 23:48:31 2011 -0800
31.2 +++ b/include/SDL_error.h Sat Feb 12 19:16:09 2011 -0800
31.3 @@ -1,6 +1,6 @@
31.4 /*
31.5 SDL - Simple DirectMedia Layer
31.6 - Copyright (C) 1997-2010 Sam Lantinga
31.7 + Copyright (C) 1997-2011 Sam Lantinga
31.8
31.9 This library is free software; you can redistribute it and/or
31.10 modify it under the terms of the GNU Lesser General Public
31.11 @@ -48,7 +48,7 @@
31.12 * \name Internal error functions
31.13 *
31.14 * \internal
31.15 - * Private error message function - used internally.
31.16 + * Private error reporting function - used internally.
31.17 */
31.18 /*@{*/
31.19 #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
32.1 --- a/include/SDL_events.h Sun Feb 06 23:48:31 2011 -0800
32.2 +++ b/include/SDL_events.h Sat Feb 12 19:16:09 2011 -0800
32.3 @@ -1,6 +1,6 @@
32.4 /*
32.5 SDL - Simple DirectMedia Layer
32.6 - Copyright (C) 1997-2010 Sam Lantinga
32.7 + Copyright (C) 1997-2011 Sam Lantinga
32.8
32.9 This library is free software; you can redistribute it and/or
32.10 modify it under the terms of the GNU Lesser General Public
32.11 @@ -151,7 +151,7 @@
32.12 Uint8 repeat; /**< Non-zero if this is a key repeat */
32.13 Uint8 padding2;
32.14 Uint8 padding3;
32.15 - SDL_KeySym keysym; /**< The key that was pressed or released */
32.16 + SDL_Keysym keysym; /**< The key that was pressed or released */
32.17 } SDL_KeyboardEvent;
32.18
32.19 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
33.1 --- a/include/SDL_gesture.h Sun Feb 06 23:48:31 2011 -0800
33.2 +++ b/include/SDL_gesture.h Sat Feb 12 19:16:09 2011 -0800
33.3 @@ -1,6 +1,6 @@
33.4 /*
33.5 SDL - Simple DirectMedia Layer
33.6 - Copyright (C) 1997-2010 Sam Lantinga
33.7 + Copyright (C) 1997-2011 Sam Lantinga
33.8
33.9 This library is free software; you can redistribute it and/or
33.10 modify it under the terms of the GNU Lesser General Public
34.1 --- a/include/SDL_hints.h Sun Feb 06 23:48:31 2011 -0800
34.2 +++ b/include/SDL_hints.h Sat Feb 12 19:16:09 2011 -0800
34.3 @@ -1,6 +1,6 @@
34.4 /*
34.5 SDL - Simple DihintsMedia Layer
34.6 - Copyright (C) 1997-2010 Sam Lantinga
34.7 + Copyright (C) 1997-2011 Sam Lantinga
34.8
34.9 This library is free software; you can redistribute it and/or
34.10 modify it under the terms of the GNU Lesser General Public
34.11 @@ -77,12 +77,27 @@
34.12 * This variable is case insensitive and can be set to the following values:
34.13 * "direct3d"
34.14 * "opengl"
34.15 + * "opengles2"
34.16 * "opengles"
34.17 * "software"
34.18 + *
34.19 + * The default varies by platform, but it's the first one in the list that
34.20 + * is available on the current platform.
34.21 */
34.22 #define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER"
34.23
34.24 /**
34.25 + * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available.
34.26 + *
34.27 + * This variable can be set to the following values:
34.28 + * "0" - Disable shaders
34.29 + * "1" - Enable shaders
34.30 + *
34.31 + * By default shaders are used if OpenGL supports them.
34.32 + */
34.33 +#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS"
34.34 +
34.35 +/**
34.36 * \brief A variable controlling whether updates to the SDL 1.2 screen surface should be synchronized with the vertical refresh, to avoid tearing.
34.37 *
34.38 * This variable can be set to the following values:
34.39 @@ -139,7 +154,7 @@
34.40 *
34.41 * This function is called during SDL_Quit() to free stored hints.
34.42 */
34.43 -extern DECLSPEC void SDLCALL SDL_ClearHints();
34.44 +extern DECLSPEC void SDLCALL SDL_ClearHints(void);
34.45
34.46
34.47 /* Ends C function definitions when using C++ */
35.1 --- a/include/SDL_input.h Sun Feb 06 23:48:31 2011 -0800
35.2 +++ b/include/SDL_input.h Sat Feb 12 19:16:09 2011 -0800
35.3 @@ -1,6 +1,6 @@
35.4 /*
35.5 SDL - Simple DirectMedia Layer
35.6 - Copyright (C) 1997-2010 Sam Lantinga
35.7 + Copyright (C) 1997-2011 Sam Lantinga
35.8
35.9 This library is free software; you can redistribute it and/or
35.10 modify it under the terms of the GNU Lesser General Public
36.1 --- a/include/SDL_joystick.h Sun Feb 06 23:48:31 2011 -0800
36.2 +++ b/include/SDL_joystick.h Sat Feb 12 19:16:09 2011 -0800
36.3 @@ -1,6 +1,6 @@
36.4 /*
36.5 SDL - Simple DirectMedia Layer
36.6 - Copyright (C) 1997-2010 Sam Lantinga
36.7 + Copyright (C) 1997-2011 Sam Lantinga
36.8
36.9 This library is free software; you can redistribute it and/or
36.10 modify it under the terms of the GNU Lesser General Public
37.1 --- a/include/SDL_keyboard.h Sun Feb 06 23:48:31 2011 -0800
37.2 +++ b/include/SDL_keyboard.h Sat Feb 12 19:16:09 2011 -0800
37.3 @@ -1,6 +1,6 @@
37.4 /*
37.5 SDL - Simple DirectMedia Layer
37.6 - Copyright (C) 1997-2010 Sam Lantinga
37.7 + Copyright (C) 1997-2011 Sam Lantinga
37.8
37.9 This library is free software; you can redistribute it and/or
37.10 modify it under the terms of the GNU Lesser General Public
37.11 @@ -45,13 +45,13 @@
37.12 /**
37.13 * \brief The SDL keysym structure, used in key events.
37.14 */
37.15 -typedef struct SDL_KeySym
37.16 +typedef struct SDL_Keysym
37.17 {
37.18 - SDL_ScanCode scancode; /**< SDL physical key code - see ::SDL_ScanCode for details */
37.19 - SDLKey sym; /**< SDL virtual key code - see ::SDLKey for details */
37.20 + SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */
37.21 + SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */
37.22 Uint16 mod; /**< current key modifiers */
37.23 Uint32 unicode; /**< \deprecated use SDL_TextInputEvent instead */
37.24 -} SDL_KeySym;
37.25 +} SDL_Keysym;
37.26
37.27 /* Function prototypes */
37.28
37.29 @@ -65,7 +65,7 @@
37.30 *
37.31 * \param numkeys if non-NULL, receives the length of the returned array.
37.32 *
37.33 - * \return An array of key states. Indexes into this array are obtained by using ::SDL_ScanCode values.
37.34 + * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
37.35 *
37.36 * \b Example:
37.37 * \code
37.38 @@ -80,34 +80,34 @@
37.39 /**
37.40 * \brief Get the current key modifier state for the keyboard.
37.41 */
37.42 -extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
37.43 +extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
37.44
37.45 /**
37.46 * \brief Set the current key modifier state for the keyboard.
37.47 *
37.48 * \note This does not change the keyboard state, only the key modifier flags.
37.49 */
37.50 -extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
37.51 +extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
37.52
37.53 /**
37.54 * \brief Get the key code corresponding to the given scancode according
37.55 * to the current keyboard layout.
37.56 *
37.57 - * See ::SDLKey for details.
37.58 + * See ::SDL_Keycode for details.
37.59 *
37.60 * \sa SDL_GetKeyName()
37.61 */
37.62 -extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_ScanCode scancode);
37.63 +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
37.64
37.65 /**
37.66 * \brief Get the scancode corresponding to the given key code according to the
37.67 * current keyboard layout.
37.68 *
37.69 - * See ::SDL_ScanCode for details.
37.70 + * See ::SDL_Scancode for details.
37.71 *
37.72 * \sa SDL_GetScancodeName()
37.73 */
37.74 -extern DECLSPEC SDL_ScanCode SDLCALL SDL_GetScancodeFromKey(SDLKey key);
37.75 +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
37.76
37.77 /**
37.78 * \brief Get a human-readable name for a scancode.
37.79 @@ -117,9 +117,9 @@
37.80 * copy it. If the scancode doesn't have a name, this function returns
37.81 * an empty string ("").
37.82 *
37.83 - * \sa SDL_ScanCode
37.84 + * \sa SDL_Scancode
37.85 */
37.86 -extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_ScanCode
37.87 +extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode
37.88 scancode);
37.89
37.90 /**
37.91 @@ -130,9 +130,9 @@
37.92 * copy it. If the key doesn't have a name, this function returns an
37.93 * empty string ("").
37.94 *
37.95 - * \sa SDLKey
37.96 + * \sa SDL_Key
37.97 */
37.98 -extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey key);
37.99 +extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
37.100
37.101 /**
37.102 * \brief Start accepting Unicode text input events.
38.1 --- a/include/SDL_keysym.h Sun Feb 06 23:48:31 2011 -0800
38.2 +++ b/include/SDL_keysym.h Sat Feb 12 19:16:09 2011 -0800
38.3 @@ -1,6 +1,6 @@
38.4 /*
38.5 SDL - Simple DirectMedia Layer
38.6 - Copyright (C) 1997-2010 Sam Lantinga
38.7 + Copyright (C) 1997-2011 Sam Lantinga
38.8
38.9 This library is free software; you can redistribute it and/or
38.10 modify it under the terms of the GNU Lesser General Public
38.11 @@ -40,7 +40,7 @@
38.12 * the unmodified character that would be generated by pressing the key, or
38.13 * an SDLK_* constant for those keys that do not generate characters.
38.14 */
38.15 -typedef Sint32 SDLKey;
38.16 +typedef Sint32 SDL_Keycode;
38.17
38.18 #define SDLK_SCANCODE_MASK (1<<30)
38.19 #define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
38.20 @@ -330,7 +330,7 @@
38.21 KMOD_CAPS = 0x2000,
38.22 KMOD_MODE = 0x4000,
38.23 KMOD_RESERVED = 0x8000
38.24 -} SDLMod;
38.25 +} SDL_Keymod;
38.26
38.27 #define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
38.28 #define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
39.1 --- a/include/SDL_loadso.h Sun Feb 06 23:48:31 2011 -0800
39.2 +++ b/include/SDL_loadso.h Sat Feb 12 19:16:09 2011 -0800
39.3 @@ -1,6 +1,6 @@
39.4 /*
39.5 SDL - Simple DirectMedia Layer
39.6 - Copyright (C) 1997-2010 Sam Lantinga
39.7 + Copyright (C) 1997-2011 Sam Lantinga
39.8
39.9 This library is free software; you can redistribute it and/or
39.10 modify it under the terms of the GNU Lesser General Public
40.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
40.2 +++ b/include/SDL_log.h Sat Feb 12 19:16:09 2011 -0800
40.3 @@ -0,0 +1,207 @@
40.4 +/*
40.5 + SDL - Simple DirectMedia Layer
40.6 + Copyright (C) 1997-2011 Sam Lantinga
40.7 +
40.8 + This library is free software; you can redistribute it and/or
40.9 + modify it under the terms of the GNU Lesser General Public
40.10 + License as published by the Free Software Foundation; either
40.11 + version 2.1 of the License, or (at your option) any later version.
40.12 +
40.13 + This library is distributed in the hope that it will be useful,
40.14 + but WITHOUT ANY WARRANTY; without even the implied warranty of
40.15 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
40.16 + Lesser General Public License for more details.
40.17 +
40.18 + You should have received a copy of the GNU Lesser General Public
40.19 + License along with this library; if not, write to the Free Software
40.20 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
40.21 +
40.22 + Sam Lantinga
40.23 + slouken@libsdl.org
40.24 +*/
40.25 +
40.26 +/**
40.27 + * \file SDL_log.h
40.28 + *
40.29 + * Simple log messages with categories and priorities.
40.30 + *
40.31 + * By default logs are quiet, but if you're debugging SDL you might want:
40.32 + *
40.33 + * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
40.34 + *
40.35 + * Here's where the messages go on different platforms:
40.36 + * Windows: debug output stream
40.37 + * Android: log output
40.38 + * Others: standard error output (stderr)
40.39 + */
40.40 +
40.41 +#ifndef _SDL_log_h
40.42 +#define _SDL_log_h
40.43 +
40.44 +#include "SDL_stdinc.h"
40.45 +
40.46 +#include "begin_code.h"
40.47 +/* Set up for C function definitions, even when using C++ */
40.48 +#ifdef __cplusplus
40.49 +/* *INDENT-OFF* */
40.50 +extern "C" {
40.51 +/* *INDENT-ON* */
40.52 +#endif
40.53 +
40.54 +
40.55 +/**
40.56 + * \brief The maximum size of a log message
40.57 + *
40.58 + * Messages longer than the maximum size will be truncated
40.59 + */
40.60 +#define SDL_MAX_LOG_MESSAGE 4096
40.61 +
40.62 +/**
40.63 + * \brief The predefined log categories
40.64 + *
40.65 + * By default the application category is enabled at the INFO level,
40.66 + * and all other categories are enabled at the CRITICAL level.
40.67 + */
40.68 +enum
40.69 +{
40.70 + SDL_LOG_CATEGORY_APPLICATION,
40.71 + SDL_LOG_CATEGORY_ERROR,
40.72 + SDL_LOG_CATEGORY_SYSTEM,
40.73 + SDL_LOG_CATEGORY_AUDIO,
40.74 + SDL_LOG_CATEGORY_VIDEO,
40.75 + SDL_LOG_CATEGORY_RENDER,
40.76 + SDL_LOG_CATEGORY_INPUT,
40.77 +
40.78 + /* Reserved for future SDL library use */
40.79 + SDL_LOG_CATEGORY_RESERVED1,
40.80 + SDL_LOG_CATEGORY_RESERVED2,
40.81 + SDL_LOG_CATEGORY_RESERVED3,
40.82 + SDL_LOG_CATEGORY_RESERVED4,
40.83 + SDL_LOG_CATEGORY_RESERVED5,
40.84 + SDL_LOG_CATEGORY_RESERVED6,
40.85 + SDL_LOG_CATEGORY_RESERVED7,
40.86 + SDL_LOG_CATEGORY_RESERVED8,
40.87 + SDL_LOG_CATEGORY_RESERVED9,
40.88 + SDL_LOG_CATEGORY_RESERVED10,
40.89 +
40.90 + /* Beyond this point is reserved for application use, e.g.
40.91 + enum {
40.92 + MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
40.93 + MYAPP_CATEGORY_AWESOME2,
40.94 + MYAPP_CATEGORY_AWESOME3,
40.95 + ...
40.96 + };
40.97 + */
40.98 + SDL_LOG_CATEGORY_CUSTOM,
40.99 +};
40.100 +
40.101 +/**
40.102 + * \brief The predefined log priorities
40.103 + */
40.104 +typedef enum
40.105 +{
40.106 + SDL_LOG_PRIORITY_VERBOSE = 1,
40.107 + SDL_LOG_PRIORITY_DEBUG,
40.108 + SDL_LOG_PRIORITY_INFO,
40.109 + SDL_LOG_PRIORITY_WARN,
40.110 + SDL_LOG_PRIORITY_ERROR,
40.111 + SDL_LOG_PRIORITY_CRITICAL,
40.112 + SDL_NUM_LOG_PRIORITIES
40.113 +} SDL_LogPriority;
40.114 +
40.115 +
40.116 +/**
40.117 + * \brief Set the priority of all log categories
40.118 + */
40.119 +extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
40.120 +
40.121 +/**
40.122 + * \brief Set the priority of a particular log category
40.123 + */
40.124 +extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
40.125 + SDL_LogPriority priority);
40.126 +
40.127 +/**
40.128 + * \brief Set the priority of a particular log category
40.129 + */
40.130 +extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
40.131 +
40.132 +/**
40.133 + * \brief Reset all priorities to default.
40.134 + *
40.135 + * \note This is called in SDL_Quit().
40.136 + */
40.137 +extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
40.138 +
40.139 +/**
40.140 + * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
40.141 + */
40.142 +extern DECLSPEC void SDLCALL SDL_Log(const char *fmt, ...);
40.143 +
40.144 +/**
40.145 + * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
40.146 + */
40.147 +extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, const char *fmt, ...);
40.148 +
40.149 +/**
40.150 + * \brief Log a message with SDL_LOG_PRIORITY_INFO
40.151 + */
40.152 +extern DECLSPEC void SDLCALL SDL_LogInfo(int category, const char *fmt, ...);
40.153 +
40.154 +/**
40.155 + * \brief Log a message with SDL_LOG_PRIORITY_WARN
40.156 + */
40.157 +extern DECLSPEC void SDLCALL SDL_LogWarn(int category, const char *fmt, ...);
40.158 +
40.159 +/**
40.160 + * \brief Log a message with SDL_LOG_PRIORITY_ERROR
40.161 + */
40.162 +extern DECLSPEC void SDLCALL SDL_LogError(int category, const char *fmt, ...);
40.163 +
40.164 +/**
40.165 + * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
40.166 + */
40.167 +extern DECLSPEC void SDLCALL SDL_LogCritical(int category, const char *fmt, ...);
40.168 +
40.169 +/**
40.170 + * \brief Log a message with the specified category and priority.
40.171 + */
40.172 +extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
40.173 + SDL_LogPriority priority,
40.174 + const char *fmt, ...);
40.175 +
40.176 +/**
40.177 + * \brief Log a message with the specified category and priority.
40.178 + */
40.179 +extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
40.180 + SDL_LogPriority priority,
40.181 + const char *fmt, va_list ap);
40.182 +
40.183 +/**
40.184 + * \brief The prototype for the log output function
40.185 + */
40.186 +typedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
40.187 +
40.188 +/**
40.189 + * \brief Get the current log output function.
40.190 + */
40.191 +extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
40.192 +
40.193 +/**
40.194 + * \brief This function allows you to replace the default log output
40.195 + * function with one of your own.
40.196 + */
40.197 +extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
40.198 +
40.199 +
40.200 +/* Ends C function definitions when using C++ */
40.201 +#ifdef __cplusplus
40.202 +/* *INDENT-OFF* */
40.203 +}
40.204 +/* *INDENT-ON* */
40.205 +#endif
40.206 +#include "close_code.h"
40.207 +
40.208 +#endif /* _SDL_log_h */
40.209 +
40.210 +/* vi: set ts=4 sw=4 expandtab: */
41.1 --- a/include/SDL_main.h Sun Feb 06 23:48:31 2011 -0800
41.2 +++ b/include/SDL_main.h Sat Feb 12 19:16:09 2011 -0800
41.3 @@ -1,6 +1,6 @@
41.4 /*
41.5 SDL - Simple DirectMedia Layer
41.6 - Copyright (C) 1997-2010 Sam Lantinga
41.7 + Copyright (C) 1997-2011 Sam Lantinga
41.8
41.9 This library is free software; you can redistribute it and/or
41.10 modify it under the terms of the GNU Lesser General Public
42.1 --- a/include/SDL_mouse.h Sun Feb 06 23:48:31 2011 -0800
42.2 +++ b/include/SDL_mouse.h Sat Feb 12 19:16:09 2011 -0800
42.3 @@ -1,6 +1,6 @@
42.4 /*
42.5 SDL - Simple DirectMedia Layer
42.6 - Copyright (C) 1997-2010 Sam Lantinga
42.7 + Copyright (C) 1997-2011 Sam Lantinga
42.8
42.9 This library is free software; you can redistribute it and/or
42.10 modify it under the terms of the GNU Lesser General Public
43.1 --- a/include/SDL_mutex.h Sun Feb 06 23:48:31 2011 -0800
43.2 +++ b/include/SDL_mutex.h Sat Feb 12 19:16:09 2011 -0800
43.3 @@ -1,6 +1,6 @@
43.4 /*
43.5 SDL - Simple DirectMedia Layer
43.6 - Copyright (C) 1997-2010 Sam Lantinga
43.7 + Copyright (C) 1997-2011 Sam Lantinga
43.8
43.9 This library is free software; you can redistribute it and/or
43.10 modify it under the terms of the GNU Lesser General Public
44.1 --- a/include/SDL_opengl.h Sun Feb 06 23:48:31 2011 -0800
44.2 +++ b/include/SDL_opengl.h Sat Feb 12 19:16:09 2011 -0800
44.3 @@ -1,6 +1,6 @@
44.4 /*
44.5 SDL - Simple DirectMedia Layer
44.6 - Copyright (C) 1997-2010 Sam Lantinga
44.7 + Copyright (C) 1997-2011 Sam Lantinga
44.8
44.9 This library is free software; you can redistribute it and/or
44.10 modify it under the terms of the GNU Lesser General Public
45.1 --- a/include/SDL_opengles.h Sun Feb 06 23:48:31 2011 -0800
45.2 +++ b/include/SDL_opengles.h Sat Feb 12 19:16:09 2011 -0800
45.3 @@ -1,6 +1,6 @@
45.4 /*
45.5 SDL - Simple DirectMedia Layer
45.6 - Copyright (C) 1997-2010 Sam Lantinga
45.7 + Copyright (C) 1997-2011 Sam Lantinga
45.8
45.9 This library is free software; you can redistribute it and/or
45.10 modify it under the terms of the GNU Lesser General Public
46.1 --- a/include/SDL_opengles2.h Sun Feb 06 23:48:31 2011 -0800
46.2 +++ b/include/SDL_opengles2.h Sat Feb 12 19:16:09 2011 -0800
46.3 @@ -1,6 +1,6 @@
46.4 /*
46.5 SDL - Simple DirectMedia Layer
46.6 - Copyright (C) 1997-2010 Sam Lantinga
46.7 + Copyright (C) 1997-2011 Sam Lantinga
46.8
46.9 This library is free software; you can redistribute it and/or
46.10 modify it under the terms of the GNU Lesser General Public
47.1 --- a/include/SDL_pixels.h Sun Feb 06 23:48:31 2011 -0800
47.2 +++ b/include/SDL_pixels.h Sat Feb 12 19:16:09 2011 -0800
47.3 @@ -1,6 +1,6 @@
47.4 /*
47.5 SDL - Simple DirectMedia Layer
47.6 - Copyright (C) 1997-2010 Sam Lantinga
47.7 + Copyright (C) 1997-2011 Sam Lantinga
47.8
47.9 This library is free software; you can redistribute it and/or
47.10 modify it under the terms of the GNU Lesser General Public
47.11 @@ -124,9 +124,7 @@
47.12 #define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
47.13 #define SDL_BYTESPERPIXEL(X) \
47.14 (SDL_ISPIXELFORMAT_FOURCC(X) ? \
47.15 - ((((X) == SDL_PIXELFORMAT_YV12) || \
47.16 - ((X) == SDL_PIXELFORMAT_IYUV) || \
47.17 - ((X) == SDL_PIXELFORMAT_YUY2) || \
47.18 + ((((X) == SDL_PIXELFORMAT_YUY2) || \
47.19 ((X) == SDL_PIXELFORMAT_UYVY) || \
47.20 ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
47.21
48.1 --- a/include/SDL_platform.h Sun Feb 06 23:48:31 2011 -0800
48.2 +++ b/include/SDL_platform.h Sat Feb 12 19:16:09 2011 -0800
48.3 @@ -1,6 +1,6 @@
48.4 /*
48.5 SDL - Simple DirectMedia Layer
48.6 - Copyright (C) 1997-2010 Sam Lantinga
48.7 + Copyright (C) 1997-2011 Sam Lantinga
48.8
48.9 This library is free software; you can redistribute it and/or
48.10 modify it under the terms of the GNU Lesser General Public
49.1 --- a/include/SDL_power.h Sun Feb 06 23:48:31 2011 -0800
49.2 +++ b/include/SDL_power.h Sat Feb 12 19:16:09 2011 -0800
49.3 @@ -1,6 +1,6 @@
49.4 /*
49.5 SDL - Simple DirectMedia Layer
49.6 - Copyright (C) 1997-2010 Sam Lantinga
49.7 + Copyright (C) 1997-2011 Sam Lantinga
49.8
49.9 This library is free software; you can redistribute it and/or
49.10 modify it under the terms of the GNU Lesser General Public
50.1 --- a/include/SDL_quit.h Sun Feb 06 23:48:31 2011 -0800
50.2 +++ b/include/SDL_quit.h Sat Feb 12 19:16:09 2011 -0800
50.3 @@ -1,6 +1,6 @@
50.4 /*
50.5 SDL - Simple DirectMedia Layer
50.6 - Copyright (C) 1997-2010 Sam Lantinga
50.7 + Copyright (C) 1997-2011 Sam Lantinga
50.8
50.9 This library is free software; you can redistribute it and/or
50.10 modify it under the terms of the GNU Lesser General Public
51.1 --- a/include/SDL_rect.h Sun Feb 06 23:48:31 2011 -0800
51.2 +++ b/include/SDL_rect.h Sat Feb 12 19:16:09 2011 -0800
51.3 @@ -1,6 +1,6 @@
51.4 /*
51.5 SDL - Simple DirectMedia Layer
51.6 - Copyright (C) 1997-2010 Sam Lantinga
51.7 + Copyright (C) 1997-2011 Sam Lantinga
51.8
51.9 This library is free software; you can redistribute it and/or
51.10 modify it under the terms of the GNU Lesser General Public
52.1 --- a/include/SDL_render.h Sun Feb 06 23:48:31 2011 -0800
52.2 +++ b/include/SDL_render.h Sat Feb 12 19:16:09 2011 -0800
52.3 @@ -1,6 +1,6 @@
52.4 /*
52.5 SDL - Simple DirectMedia Layer
52.6 - Copyright (C) 1997-2010 Sam Lantinga
52.7 + Copyright (C) 1997-2011 Sam Lantinga
52.8
52.9 This library is free software; you can redistribute it and/or
52.10 modify it under the terms of the GNU Lesser General Public
52.11 @@ -192,6 +192,7 @@
52.12 * of range.
52.13 *
52.14 * \sa SDL_QueryTexture()
52.15 + * \sa SDL_UpdateTexture()
52.16 * \sa SDL_DestroyTexture()
52.17 */
52.18 extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format,
52.19 @@ -363,6 +364,18 @@
52.20 extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
52.21
52.22 /**
52.23 + * \brief Set the clipping rectangle for rendering on the current target
52.24 + *
52.25 + * \param rect The rectangle to clip rendering to, or NULL to disable clipping.
52.26 + *
52.27 + * The contents of the window are not defined after calling
52.28 + * SDL_RenderPresent(), so you should clear the clip rectangle and draw
52.29 + * over the entire window each frame.
52.30 + */
52.31 +extern DECLSPEC void SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer,
52.32 + const SDL_Rect * rect);
52.33 +
52.34 +/**
52.35 * \brief Set the color used for drawing operations (Fill and Line).
52.36 *
52.37 * \param r The red value used to draw on the rendering target.
53.1 --- a/include/SDL_rwops.h Sun Feb 06 23:48:31 2011 -0800
53.2 +++ b/include/SDL_rwops.h Sat Feb 12 19:16:09 2011 -0800
53.3 @@ -1,6 +1,6 @@
53.4 /*
53.5 SDL - Simple DirectMedia Layer
53.6 - Copyright (C) 1997-2010 Sam Lantinga
53.7 + Copyright (C) 1997-2011 Sam Lantinga
53.8
53.9 This library is free software; you can redistribute it and/or
53.10 modify it under the terms of the GNU Lesser General Public
54.1 --- a/include/SDL_scancode.h Sun Feb 06 23:48:31 2011 -0800
54.2 +++ b/include/SDL_scancode.h Sat Feb 12 19:16:09 2011 -0800
54.3 @@ -1,6 +1,6 @@
54.4 /*
54.5 SDL - Simple DirectMedia Layer
54.6 - Copyright (C) 1997-2010 Sam Lantinga
54.7 + Copyright (C) 1997-2011 Sam Lantinga
54.8
54.9 This library is free software; you can redistribute it and/or
54.10 modify it under the terms of the GNU Lesser General Public
54.11 @@ -35,7 +35,7 @@
54.12 * \brief The SDL keyboard scancode representation.
54.13 *
54.14 * Values of this type are used to represent keyboard keys, among other places
54.15 - * in the \link SDL_KeySym::scancode key.keysym.scancode \endlink field of the
54.16 + * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
54.17 * SDL_Event structure.
54.18 *
54.19 * The values in this enumeration are based on the USB usage page standard:
54.20 @@ -392,7 +392,7 @@
54.21
54.22 SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
54.23 for array bounds */
54.24 -} SDL_ScanCode;
54.25 +} SDL_Scancode;
54.26
54.27 #endif /* _SDL_scancode_h */
54.28
55.1 --- a/include/SDL_stdinc.h Sun Feb 06 23:48:31 2011 -0800
55.2 +++ b/include/SDL_stdinc.h Sat Feb 12 19:16:09 2011 -0800
55.3 @@ -1,6 +1,6 @@
55.4 /*
55.5 SDL - Simple DirectMedia Layer
55.6 - Copyright (C) 1997-2010 Sam Lantinga
55.7 + Copyright (C) 1997-2011 Sam Lantinga
55.8
55.9 This library is free software; you can redistribute it and/or
55.10 modify it under the terms of the GNU Lesser General Public
56.1 --- a/include/SDL_surface.h Sun Feb 06 23:48:31 2011 -0800
56.2 +++ b/include/SDL_surface.h Sat Feb 12 19:16:09 2011 -0800
56.3 @@ -1,6 +1,6 @@
56.4 /*
56.5 SDL - Simple DirectMedia Layer
56.6 - Copyright (C) 1997-2010 Sam Lantinga
56.7 + Copyright (C) 1997-2011 Sam Lantinga
56.8
56.9 This library is free software; you can redistribute it and/or
56.10 modify it under the terms of the GNU Lesser General Public
56.11 @@ -434,22 +434,6 @@
56.12 source colour key.
56.13 \endverbatim
56.14 *
56.15 - * If either of the surfaces were in video memory, and the blit returns -2,
56.16 - * the video memory was lost, so it should be reloaded with artwork and
56.17 - * re-blitted:
56.18 - * @code
56.19 - * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
56.20 - * while ( SDL_LockSurface(image) < 0 )
56.21 - * Sleep(10);
56.22 - * -- Write image pixels to image->pixels --
56.23 - * SDL_UnlockSurface(image);
56.24 - * }
56.25 - * @endcode
56.26 - *
56.27 - * This happens under DirectX 5.0 when the system switches away from your
56.28 - * fullscreen application. The lock will also fail until you have access
56.29 - * to the video memory again.
56.30 - *
56.31 * You should call SDL_BlitSurface() unless you know exactly how SDL
56.32 * blitting works internally and how to use the other blit functions.
56.33 */
57.1 --- a/include/SDL_syswm.h Sun Feb 06 23:48:31 2011 -0800
57.2 +++ b/include/SDL_syswm.h Sat Feb 12 19:16:09 2011 -0800
57.3 @@ -1,6 +1,6 @@
57.4 /*
57.5 SDL - Simple DirectMedia Layer
57.6 - Copyright (C) 1997-2010 Sam Lantinga
57.7 + Copyright (C) 1997-2011 Sam Lantinga
57.8
57.9 This library is free software; you can redistribute it and/or
57.10 modify it under the terms of the GNU Lesser General Public
58.1 --- a/include/SDL_thread.h Sun Feb 06 23:48:31 2011 -0800
58.2 +++ b/include/SDL_thread.h Sat Feb 12 19:16:09 2011 -0800
58.3 @@ -1,6 +1,6 @@
58.4 /*
58.5 SDL - Simple DirectMedia Layer
58.6 - Copyright (C) 1997-2010 Sam Lantinga
58.7 + Copyright (C) 1997-2011 Sam Lantinga
58.8
58.9 This library is free software; you can redistribute it and/or
58.10 modify it under the terms of the GNU Lesser General Public
59.1 --- a/include/SDL_timer.h Sun Feb 06 23:48:31 2011 -0800
59.2 +++ b/include/SDL_timer.h Sat Feb 12 19:16:09 2011 -0800
59.3 @@ -1,6 +1,6 @@
59.4 /*
59.5 SDL - Simple DirectMedia Layer
59.6 - Copyright (C) 1997-2010 Sam Lantinga
59.7 + Copyright (C) 1997-2011 Sam Lantinga
59.8
59.9 This library is free software; you can redistribute it and/or
59.10 modify it under the terms of the GNU Lesser General Public
60.1 --- a/include/SDL_touch.h Sun Feb 06 23:48:31 2011 -0800
60.2 +++ b/include/SDL_touch.h Sat Feb 12 19:16:09 2011 -0800
60.3 @@ -1,6 +1,6 @@
60.4 /*
60.5 SDL - Simple DirectMedia Layer
60.6 - Copyright (C) 1997-2010 Sam Lantinga
60.7 + Copyright (C) 1997-2011 Sam Lantinga
60.8
60.9 This library is free software; you can redistribute it and/or
60.10 modify it under the terms of the GNU Lesser General Public
61.1 --- a/include/SDL_types.h Sun Feb 06 23:48:31 2011 -0800
61.2 +++ b/include/SDL_types.h Sat Feb 12 19:16:09 2011 -0800
61.3 @@ -1,6 +1,6 @@
61.4 /*
61.5 SDL - Simple DirectMedia Layer
61.6 - Copyright (C) 1997-2010 Sam Lantinga
61.7 + Copyright (C) 1997-2011 Sam Lantinga
61.8
61.9 This library is free software; you can redistribute it and/or
61.10 modify it under the terms of the GNU Lesser General Public
62.1 --- a/include/SDL_version.h Sun Feb 06 23:48:31 2011 -0800
62.2 +++ b/include/SDL_version.h Sat Feb 12 19:16:09 2011 -0800
62.3 @@ -1,6 +1,6 @@
62.4 /*
62.5 SDL - Simple DirectMedia Layer
62.6 - Copyright (C) 1997-2010 Sam Lantinga
62.7 + Copyright (C) 1997-2011 Sam Lantinga
62.8
62.9 This library is free software; you can redistribute it and/or
62.10 modify it under the terms of the GNU Lesser General Public
63.1 --- a/include/SDL_video.h Sun Feb 06 23:48:31 2011 -0800
63.2 +++ b/include/SDL_video.h Sat Feb 12 19:16:09 2011 -0800
63.3 @@ -1,6 +1,6 @@
63.4 /*
63.5 SDL - Simple DirectMedia Layer
63.6 - Copyright (C) 1997-2010 Sam Lantinga
63.7 + Copyright (C) 1997-2011 Sam Lantinga
63.8
63.9 This library is free software; you can redistribute it and/or
63.10 modify it under the terms of the GNU Lesser General Public
63.11 @@ -113,12 +113,20 @@
63.12 /**
63.13 * \brief Used to indicate that you don't care what the window position is.
63.14 */
63.15 -#define SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF
63.16 +#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000
63.17 +#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
63.18 +#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
63.19 +#define SDL_WINDOWPOS_ISUNDEFINED(X) \
63.20 + (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
63.21
63.22 /**
63.23 * \brief Used to indicate that the window position should be centered.
63.24 */
63.25 -#define SDL_WINDOWPOS_CENTERED 0x7FFFFFE
63.26 +#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000
63.27 +#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X))
63.28 +#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)
63.29 +#define SDL_WINDOWPOS_ISCENTERED(X) \
63.30 + (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
63.31
63.32 /**
63.33 * \brief Event subtype for window events
63.34 @@ -236,7 +244,6 @@
63.35 * \brief Returns the number of available video displays.
63.36 *
63.37 * \sa SDL_GetDisplayBounds()
63.38 - * \sa SDL_SelectVideoDisplay()
63.39 */
63.40 extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
63.41
63.42 @@ -248,34 +255,14 @@
63.43 *
63.44 * \sa SDL_GetNumVideoDisplays()
63.45 */
63.46 -extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int index, SDL_Rect * rect);
63.47 +extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect);
63.48
63.49 /**
63.50 - * \brief Set the index of the currently selected display.
63.51 - *
63.52 - * \return 0 on success, or -1 if the index is out of range.
63.53 - *
63.54 - * \sa SDL_GetNumVideoDisplays()
63.55 - * \sa SDL_GetCurrentVideoDisplay()
63.56 - */
63.57 -extern DECLSPEC int SDLCALL SDL_SelectVideoDisplay(int index);
63.58 -
63.59 -/**
63.60 - * \brief Get the index of the currently selected display.
63.61 - *
63.62 - * \return The index of the currently selected display.
63.63 - *
63.64 - * \sa SDL_GetNumVideoDisplays()
63.65 - * \sa SDL_SelectVideoDisplay()
63.66 - */
63.67 -extern DECLSPEC int SDLCALL SDL_GetCurrentVideoDisplay(void);
63.68 -
63.69 -/**
63.70 - * \brief Returns the number of available display modes for the current display.
63.71 + * \brief Returns the number of available display modes.
63.72 *
63.73 * \sa SDL_GetDisplayMode()
63.74 */
63.75 -extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(void);
63.76 +extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex);
63.77
63.78 /**
63.79 * \brief Fill in information about a specific display mode.
63.80 @@ -288,19 +275,18 @@
63.81 *
63.82 * \sa SDL_GetNumDisplayModes()
63.83 */
63.84 -extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int index,
63.85 +extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex,
63.86 SDL_DisplayMode * mode);
63.87
63.88 /**
63.89 - * \brief Fill in information about the desktop display mode for the current
63.90 - * display.
63.91 + * \brief Fill in information about the desktop display mode.
63.92 */
63.93 -extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayMode * mode);
63.94 +extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode);
63.95
63.96 /**
63.97 * \brief Fill in information about the current display mode.
63.98 */
63.99 -extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayMode * mode);
63.100 +extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode);
63.101
63.102
63.103 /**
63.104 @@ -323,16 +309,21 @@
63.105 * \sa SDL_GetNumDisplayModes()
63.106 * \sa SDL_GetDisplayMode()
63.107 */
63.108 -extern DECLSPEC SDL_DisplayMode *SDLCALL SDL_GetClosestDisplayMode(const
63.109 - SDL_DisplayMode
63.110 - * mode,
63.111 - SDL_DisplayMode
63.112 - * closest);
63.113 +extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
63.114
63.115 /**
63.116 - * \brief Set the display mode used when a fullscreen window is visible
63.117 - * on the currently selected display. By default the window's
63.118 - * dimensions and the desktop format and refresh rate are used.
63.119 + * \brief Get the display index associated with a window.
63.120 + *
63.121 + * \return the display index of the display containing the center of the
63.122 + * window, or -1 on error.
63.123 + */
63.124 +extern DECLSPEC int SDLCALL SDL_GetWindowDisplay(SDL_Window * window);
63.125 +
63.126 +/**
63.127 + * \brief Set the display mode used when a fullscreen window is visible.
63.128 + *
63.129 + * By default the window's dimensions and the desktop format and refresh rate
63.130 + * are used.
63.131 *
63.132 * \param mode The mode to use, or NULL for the default mode.
63.133 *
63.134 @@ -347,7 +338,7 @@
63.135
63.136 /**
63.137 * \brief Fill in information about the display mode used when a fullscreen
63.138 - * window is visible on the currently selected display.
63.139 + * window is visible.
63.140 *
63.141 * \sa SDL_SetWindowDisplayMode()
63.142 * \sa SDL_SetWindowFullscreen()
63.143 @@ -361,55 +352,6 @@
63.144 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window);
63.145
63.146 /**
63.147 - * \brief Set the gamma correction for each of the color channels on the
63.148 - * currently selected display.
63.149 - *
63.150 - * \return 0 on success, or -1 if setting the gamma isn't supported.
63.151 - *
63.152 - * \sa SDL_SetGammaRamp()
63.153 - */
63.154 -extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
63.155 -
63.156 -/**
63.157 - * \brief Set the gamma ramp for the currently selected display.
63.158 - *
63.159 - * \param red The translation table for the red channel, or NULL.
63.160 - * \param green The translation table for the green channel, or NULL.
63.161 - * \param blue The translation table for the blue channel, or NULL.
63.162 - *
63.163 - * \return 0 on success, or -1 if gamma ramps are unsupported.
63.164 - *
63.165 - * Set the gamma translation table for the red, green, and blue channels
63.166 - * of the video hardware. Each table is an array of 256 16-bit quantities,
63.167 - * representing a mapping between the input and output for that channel.
63.168 - * The input is the index into the array, and the output is the 16-bit
63.169 - * gamma value at that index, scaled to the output color precision.
63.170 - *
63.171 - * \sa SDL_GetGammaRamp()
63.172 - */
63.173 -extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red,
63.174 - const Uint16 * green,
63.175 - const Uint16 * blue);
63.176 -
63.177 -/**
63.178 - * \brief Get the gamma ramp for the currently selected display.
63.179 - *
63.180 - * \param red A pointer to a 256 element array of 16-bit quantities to hold
63.181 - * the translation table for the red channel, or NULL.
63.182 - * \param green A pointer to a 256 element array of 16-bit quantities to hold
63.183 - * the translation table for the green channel, or NULL.
63.184 - * \param blue A pointer to a 256 element array of 16-bit quantities to hold
63.185 - * the translation table for the blue channel, or NULL.
63.186 - *
63.187 - * \return 0 on success, or -1 if gamma ramps are unsupported.
63.188 - *
63.189 - * \sa SDL_SetGammaRamp()
63.190 - */
63.191 -extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green,
63.192 - Uint16 * blue);
63.193 -
63.194 -
63.195 -/**
63.196 * \brief Create a window with the specified position, dimensions, and flags.
63.197 *
63.198 * \param title The title of the window, in UTF-8 encoding.
63.199 @@ -605,7 +547,7 @@
63.200 * \sa SDL_GetWindowDisplayMode()
63.201 */
63.202 extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window,
63.203 - int fullscreen);
63.204 + SDL_bool fullscreen);
63.205
63.206 /**
63.207 * \brief Get an SDL surface associated with the window.
63.208 @@ -661,16 +603,6 @@
63.209 extern DECLSPEC int SDLCALL SDL_GetWindowGrab(SDL_Window * window);
63.210
63.211 /**
63.212 - * \brief Get driver specific information about a window.
63.213 - *
63.214 - * \note Include SDL_syswm.h for the declaration of SDL_SysWMinfo.
63.215 - */
63.216 -struct SDL_SysWMinfo;
63.217 -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
63.218 - struct SDL_SysWMinfo
63.219 - *info);
63.220 -
63.221 -/**
63.222 * \brief Destroy a window.
63.223 */
63.224 extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window);
64.1 --- a/include/begin_code.h Sun Feb 06 23:48:31 2011 -0800
64.2 +++ b/include/begin_code.h Sat Feb 12 19:16:09 2011 -0800
64.3 @@ -1,6 +1,6 @@
64.4 /*
64.5 SDL - Simple DirectMedia Layer
64.6 - Copyright (C) 1997-2010 Sam Lantinga
64.7 + Copyright (C) 1997-2011 Sam Lantinga
64.8
64.9 This library is free software; you can redistribute it and/or
64.10 modify it under the terms of the GNU Lesser General Public
65.1 --- a/include/close_code.h Sun Feb 06 23:48:31 2011 -0800
65.2 +++ b/include/close_code.h Sat Feb 12 19:16:09 2011 -0800
65.3 @@ -1,6 +1,6 @@
65.4 /*
65.5 SDL - Simple DirectMedia Layer
65.6 - Copyright (C) 1997-2010 Sam Lantinga
65.7 + Copyright (C) 1997-2011 Sam Lantinga
65.8
65.9 This library is free software; you can redistribute it and/or
65.10 modify it under the terms of the GNU Lesser General Public
66.1 --- a/src/SDL.c Sun Feb 06 23:48:31 2011 -0800
66.2 +++ b/src/SDL.c Sat Feb 12 19:16:09 2011 -0800
66.3 @@ -1,6 +1,6 @@
66.4 /*
66.5 SDL - Simple DirectMedia Layer
66.6 - Copyright (C) 1997-2010 Sam Lantinga
66.7 + Copyright (C) 1997-2011 Sam Lantinga
66.8
66.9 This library is free software; you can redistribute it and/or
66.10 modify it under the terms of the GNU Lesser General Public
66.11 @@ -29,10 +29,6 @@
66.12 #include "haptic/SDL_haptic_c.h"
66.13 #include "joystick/SDL_joystick_c.h"
66.14
66.15 -#if !SDL_VIDEO_DISABLED
66.16 -#include "video/SDL_leaks.h"
66.17 -#endif
66.18 -
66.19 /* Initialization/Cleanup routines */
66.20 #if !SDL_TIMERS_DISABLED
66.21 extern void SDL_StartTicks(void);
66.22 @@ -49,9 +45,6 @@
66.23 static Uint32 SDL_initialized = 0;
66.24 static Uint32 ticks_started = 0;
66.25
66.26 -#ifdef CHECK_LEAKS
66.27 -int surfaces_allocated = 0;
66.28 -#endif
66.29
66.30 int
66.31 SDL_InitSubSystem(Uint32 flags)
66.32 @@ -215,45 +208,17 @@
66.33 SDL_Quit(void)
66.34 {
66.35 /* Quit all subsystems */
66.36 -#ifdef DEBUG_BUILD
66.37 - printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n");
66.38 - fflush(stdout);
66.39 -#endif
66.40 -
66.41 #if defined(__WIN32__)
66.42 SDL_HelperWindowDestroy();
66.43 #endif
66.44 SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
66.45
66.46 -#ifdef CHECK_LEAKS
66.47 -#ifdef DEBUG_BUILD
66.48 - printf("[SDL_Quit] : CHECK_LEAKS\n");
66.49 - fflush(stdout);
66.50 -#endif
66.51 -
66.52 - /* !!! FIXME: make this an assertion. */
66.53 - /* Print the number of surfaces not freed */
66.54 - if (surfaces_allocated != 0) {
66.55 - fprintf(stderr, "SDL Warning: %d SDL surfaces extant\n",
66.56 - surfaces_allocated);
66.57 - }
66.58 -#endif
66.59 -#ifdef DEBUG_BUILD
66.60 - printf("[SDL_Quit] : SDL_UninstallParachute()\n");
66.61 - fflush(stdout);
66.62 -#endif
66.63 -
66.64 /* Uninstall any parachute signal handlers */
66.65 SDL_UninstallParachute();
66.66
66.67 SDL_ClearHints();
66.68 SDL_AssertionsQuit();
66.69 -
66.70 -#ifdef DEBUG_BUILD
66.71 - printf("[SDL_Quit] : Returning!\n");
66.72 - fflush(stdout);
66.73 -#endif
66.74 -
66.75 + SDL_LogResetPriorities();
66.76 }
66.77
66.78 /* Get the library version number */
66.79 @@ -301,6 +266,8 @@
66.80 return "Mac OS X";
66.81 #elif __NETBSD__
66.82 return "NetBSD";
66.83 +#elif __NDS__
66.84 + return "Nintendo DS";
66.85 #elif __OPENBSD__
66.86 return "OpenBSD";
66.87 #elif __OS2__
67.1 --- a/src/SDL_assert.c Sun Feb 06 23:48:31 2011 -0800
67.2 +++ b/src/SDL_assert.c Sat Feb 12 19:16:09 2011 -0800
67.3 @@ -1,6 +1,6 @@
67.4 /*
67.5 SDL - Simple DirectMedia Layer
67.6 - Copyright (C) 1997-2010 Sam Lantinga
67.7 + Copyright (C) 1997-2011 Sam Lantinga
67.8
67.9 This library is free software; you can redistribute it and/or
67.10 modify it under the terms of the GNU Lesser General Public
68.1 --- a/src/SDL_assert_c.h Sun Feb 06 23:48:31 2011 -0800
68.2 +++ b/src/SDL_assert_c.h Sat Feb 12 19:16:09 2011 -0800
68.3 @@ -1,6 +1,6 @@
68.4 /*
68.5 SDL - Simple DirectMedia Layer
68.6 - Copyright (C) 1997-2010 Sam Lantinga
68.7 + Copyright (C) 1997-2011 Sam Lantinga
68.8
68.9 This library is free software; you can redistribute it and/or
68.10 modify it under the terms of the GNU Lesser General Public
69.1 --- a/src/SDL_compat.c Sun Feb 06 23:48:31 2011 -0800
69.2 +++ b/src/SDL_compat.c Sat Feb 12 19:16:09 2011 -0800
69.3 @@ -1,6 +1,6 @@
69.4 /*
69.5 SDL - Simple DirectMedia Layer
69.6 - Copyright (C) 1997-2010 Sam Lantinga
69.7 + Copyright (C) 1997-2011 Sam Lantinga
69.8
69.9 This library is free software; you can redistribute it and/or
69.10 modify it under the terms of the GNU Lesser General Public
69.11 @@ -71,15 +71,17 @@
69.12 return NULL;
69.13 }
69.14
69.15 -static void
69.16 -SelectVideoDisplay()
69.17 +static int
69.18 +GetVideoDisplay()
69.19 {
69.20 const char *variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_DISPLAY");
69.21 if ( !variable ) {
69.22 variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_HEAD");
69.23 }
69.24 if ( variable ) {
69.25 - SDL_SelectVideoDisplay(SDL_atoi(variable));
69.26 + return SDL_atoi(variable);
69.27 + } else {
69.28 + return 0;
69.29 }
69.30 }
69.31
69.32 @@ -89,10 +91,8 @@
69.33 static SDL_VideoInfo info;
69.34 SDL_DisplayMode mode;
69.35
69.36 - SelectVideoDisplay();
69.37 -
69.38 /* Memory leak, compatibility code, who cares? */
69.39 - if (!info.vfmt && SDL_GetDesktopDisplayMode(&mode) == 0) {
69.40 + if (!info.vfmt && SDL_GetDesktopDisplayMode(GetVideoDisplay(), &mode) == 0) {
69.41 int bpp;
69.42 Uint32 Rmask, Gmask, Bmask, Amask;
69.43
69.44 @@ -114,17 +114,15 @@
69.45 return 0;
69.46 }
69.47
69.48 - SelectVideoDisplay();
69.49 -
69.50 if (!(flags & SDL_FULLSCREEN)) {
69.51 SDL_DisplayMode mode;
69.52 - SDL_GetDesktopDisplayMode(&mode);
69.53 + SDL_GetDesktopDisplayMode(GetVideoDisplay(), &mode);
69.54 return SDL_BITSPERPIXEL(mode.format);
69.55 }
69.56
69.57 - for (i = 0; i < SDL_GetNumDisplayModes(); ++i) {
69.58 + for (i = 0; i < SDL_GetNumDisplayModes(GetVideoDisplay()); ++i) {
69.59 SDL_DisplayMode mode;
69.60 - SDL_GetDisplayMode(i, &mode);
69.61 + SDL_GetDisplayMode(GetVideoDisplay(), i, &mode);
69.62 if (!mode.w || !mode.h || (width == mode.w && height == mode.h)) {
69.63 if (!mode.format) {
69.64 return bpp;
69.65 @@ -147,8 +145,6 @@
69.66 return NULL;
69.67 }
69.68
69.69 - SelectVideoDisplay();
69.70 -
69.71 if (!(flags & SDL_FULLSCREEN)) {
69.72 return (SDL_Rect **) (-1);
69.73 }
69.74 @@ -160,11 +156,11 @@
69.75 /* Memory leak, but this is a compatibility function, who cares? */
69.76 nmodes = 0;
69.77 modes = NULL;
69.78 - for (i = 0; i < SDL_GetNumDisplayModes(); ++i) {
69.79 + for (i = 0; i < SDL_GetNumDisplayModes(GetVideoDisplay()); ++i) {
69.80 SDL_DisplayMode mode;
69.81 int bpp;
69.82
69.83 - SDL_GetDisplayMode(i, &mode);
69.84 + SDL_GetDisplayMode(GetVideoDisplay(), i, &mode);
69.85 if (!mode.w || !mode.h) {
69.86 return (SDL_Rect **) (-1);
69.87 }
69.88 @@ -342,7 +338,7 @@
69.89 }
69.90 if (center) {
69.91 SDL_DisplayMode mode;
69.92 - SDL_GetDesktopDisplayMode(&mode);
69.93 + SDL_GetDesktopDisplayMode(GetVideoDisplay(), &mode);
69.94 *x = (mode.w - w) / 2;
69.95 *y = (mode.h - h) / 2;
69.96 }
69.97 @@ -453,9 +449,7 @@
69.98 }
69.99 }
69.100
69.101 - SelectVideoDisplay();
69.102 -
69.103 - SDL_GetDesktopDisplayMode(&desktop_mode);
69.104 + SDL_GetDesktopDisplayMode(GetVideoDisplay(), &desktop_mode);
69.105
69.106 if (width == 0) {
69.107 width = desktop_mode.w;
69.108 @@ -525,7 +519,7 @@
69.109 if (window_flags & SDL_WINDOW_FULLSCREEN) {
69.110 surface_flags |= SDL_FULLSCREEN;
69.111 }
69.112 - if (window_flags & SDL_WINDOW_OPENGL) {
69.113 + if ((window_flags & SDL_WINDOW_OPENGL) && (flags & SDL_OPENGL)) {
69.114 surface_flags |= SDL_OPENGL;
69.115 }
69.116 if (window_flags & SDL_WINDOW_RESIZABLE) {
69.117 @@ -1526,6 +1520,26 @@
69.118 SDL_GL_SwapWindow(SDL_VideoWindow);
69.119 }
69.120
69.121 +int
69.122 +SDL_SetGamma(float red, float green, float blue)
69.123 +{
69.124 + SDL_Unsupported();
69.125 + return -1;
69.126 +}
69.127 +
69.128 +int
69.129 +SDL_SetGammaRamp(const Uint16 * red, const Uint16 * green, const Uint16 * blue)
69.130 +{
69.131 + SDL_Unsupported();
69.132 + return -1;
69.133 +}
69.134 +
69.135 +int
69.136 +SDL_GetGammaRamp(Uint16 * red, Uint16 * green, Uint16 * blue)
69.137 +{
69.138 + SDL_Unsupported();
69.139 + return -1;
69.140 +}
69.141
69.142 int
69.143 SDL_EnableKeyRepeat(int delay, int interval)
70.1 --- a/src/SDL_error.c Sun Feb 06 23:48:31 2011 -0800
70.2 +++ b/src/SDL_error.c Sat Feb 12 19:16:09 2011 -0800
70.3 @@ -1,6 +1,6 @@
70.4 /*
70.5 SDL - Simple DirectMedia Layer
70.6 - Copyright (C) 1997-2010 Sam Lantinga
70.7 + Copyright (C) 1997-2011 Sam Lantinga
70.8
70.9 This library is free software; you can redistribute it and/or
70.10 modify it under the terms of the GNU Lesser General Public
70.11 @@ -23,14 +23,10 @@
70.12
70.13 /* Simple error handling in SDL */
70.14
70.15 -#ifdef __ANDROID__
70.16 -#include <android/log.h>
70.17 -#endif
70.18 -
70.19 +#include "SDL_log.h"
70.20 #include "SDL_error.h"
70.21 #include "SDL_error_c.h"
70.22
70.23 -/*#define DEBUG_ERROR*/
70.24
70.25 /* Routine to get the thread-specific error variable */
70.26 #if SDL_THREADS_DISABLED
70.27 @@ -113,12 +109,7 @@
70.28 va_end(ap);
70.29
70.30 /* If we are in debug mode, print out an error message */
70.31 -#ifdef DEBUG_ERROR
70.32 - fprintf(stderr, "SDL_SetError: %s\n", SDL_GetError());
70.33 -#ifdef __ANDROID__
70.34 - __android_log_print(ANDROID_LOG_INFO, "SDL", "ERROR: %s", SDL_GetError());
70.35 -#endif
70.36 -#endif /* DEBUG_ERROR */
70.37 + SDL_LogError(SDL_LOG_CATEGORY_ERROR, "%s", SDL_GetError());
70.38 }
70.39
70.40 /* This function has a bit more overhead than most error functions
71.1 --- a/src/SDL_error_c.h Sun Feb 06 23:48:31 2011 -0800
71.2 +++ b/src/SDL_error_c.h Sat Feb 12 19:16:09 2011 -0800
71.3 @@ -1,6 +1,6 @@
71.4 /*
71.5 SDL - Simple DirectMedia Layer
71.6 - Copyright (C) 1997-2010 Sam Lantinga
71.7 + Copyright (C) 1997-2011 Sam Lantinga
71.8
71.9 This library is free software; you can redistribute it and/or
71.10 modify it under the terms of the GNU Lesser General Public
72.1 --- a/src/SDL_fatal.c Sun Feb 06 23:48:31 2011 -0800
72.2 +++ b/src/SDL_fatal.c Sat Feb 12 19:16:09 2011 -0800
72.3 @@ -1,6 +1,6 @@
72.4 /*
72.5 SDL - Simple DirectMedia Layer
72.6 - Copyright (C) 1997-2010 Sam Lantinga
72.7 + Copyright (C) 1997-2011 Sam Lantinga
72.8
72.9 This library is free software; you can redistribute it and/or
72.10 modify it under the terms of the GNU Lesser General Public
73.1 --- a/src/SDL_fatal.h Sun Feb 06 23:48:31 2011 -0800
73.2 +++ b/src/SDL_fatal.h Sat Feb 12 19:16:09 2011 -0800
73.3 @@ -1,6 +1,6 @@
73.4 /*
73.5 SDL - Simple DirectMedia Layer
73.6 - Copyright (C) 1997-2010 Sam Lantinga
73.7 + Copyright (C) 1997-2011 Sam Lantinga
73.8
73.9 This library is free software; you can redistribute it and/or
73.10 modify it under the terms of the GNU Lesser General Public
74.1 --- a/src/SDL_hints.c Sun Feb 06 23:48:31 2011 -0800
74.2 +++ b/src/SDL_hints.c Sat Feb 12 19:16:09 2011 -0800
74.3 @@ -1,6 +1,6 @@
74.4 /*
74.5 SDL - Simple DirectMedia Layer
74.6 - Copyright (C) 1997-2010 Sam Lantinga
74.7 + Copyright (C) 1997-2011 Sam Lantinga
74.8
74.9 This library is free software; you can redistribute it and/or
74.10 modify it under the terms of the GNU Lesser General Public
74.11 @@ -105,7 +105,7 @@
74.12 return env;
74.13 }
74.14
74.15 -void SDL_ClearHints()
74.16 +void SDL_ClearHints(void)
74.17 {
74.18 SDL_Hint *hint;
74.19
75.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
75.2 +++ b/src/SDL_log.c Sat Feb 12 19:16:09 2011 -0800
75.3 @@ -0,0 +1,320 @@
75.4 +/*
75.5 + SDL - Simple DirectMedia Layer
75.6 + Copyright (C) 1997-2011 Sam Lantinga
75.7 +
75.8 + This library is free software; you can redistribute it and/or
75.9 + modify it under the terms of the GNU Lesser General Public
75.10 + License as published by the Free Software Foundation; either
75.11 + version 2.1 of the License, or (at your option) any later version.
75.12 +
75.13 + This library is distributed in the hope that it will be useful,
75.14 + but WITHOUT ANY WARRANTY; without even the implied warranty of
75.15 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
75.16 + Lesser General Public License for more details.
75.17 +
75.18 + You should have received a copy of the GNU Lesser General Public
75.19 + License along with this library; if not, write to the Free Software
75.20 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
75.21 +
75.22 + Sam Lantinga
75.23 + slouken@libsdl.org
75.24 +*/
75.25 +#include "SDL_config.h"
75.26 +
75.27 +/* Simple log messages in SDL */
75.28 +
75.29 +#include "SDL_log.h"
75.30 +
75.31 +#if HAVE_STDIO_H
75.32 +#include <stdio.h>
75.33 +#endif
75.34 +
75.35 +#if defined(__WIN32__)
75.36 +#include "core/windows/SDL_windows.h"
75.37 +#elif defined(__ANDROID__)
75.38 +#include <android/log.h>
75.39 +#endif
75.40 +
75.41 +#define DEFAULT_PRIORITY SDL_LOG_PRIORITY_CRITICAL
75.42 +#define DEFAULT_APPLICATION_PRIORITY SDL_LOG_PRIORITY_INFO
75.43 +
75.44 +typedef struct SDL_LogLevel
75.45 +{
75.46 + int category;
75.47 + SDL_LogPriority priority;
75.48 + struct SDL_LogLevel *next;
75.49 +} SDL_LogLevel;
75.50 +
75.51 +/* The default log output function */
75.52 +static void SDL_LogOutput(void *userdata,
75.53 + int category, SDL_LogPriority priority,
75.54 + const char *message);
75.55 +
75.56 +static SDL_LogLevel *SDL_loglevels;
75.57 +static SDL_LogPriority SDL_application_priority = DEFAULT_APPLICATION_PRIORITY;
75.58 +static SDL_LogPriority SDL_default_priority = DEFAULT_PRIORITY;
75.59 +static SDL_LogOutputFunction SDL_log_function = SDL_LogOutput;
75.60 +static void *SDL_log_userdata = NULL;
75.61 +
75.62 +static const char *SDL_priority_prefixes[SDL_NUM_LOG_PRIORITIES] = {
75.63 + NULL,
75.64 + "VERBOSE",
75.65 + "DEBUG",
75.66 + "INFO",
75.67 + "WARN",
75.68 + "ERROR",
75.69 + "CRITICAL"
75.70 +};
75.71 +
75.72 +#ifdef __ANDROID__
75.73 +static const char *SDL_category_prefixes[SDL_LOG_CATEGORY_RESERVED1] = {
75.74 + "APP",
75.75 + "ERROR",
75.76 + "SYSTEM",
75.77 + "AUDIO",
75.78 + "VIDEO",
75.79 + "RENDER",
75.80 + "INPUT"
75.81 +};
75.82 +
75.83 +static int SDL_android_priority[SDL_NUM_LOG_PRIORITIES] = {
75.84 + ANDROID_LOG_VERBOSE,
75.85 + ANDROID_LOG_DEBUG,
75.86 + ANDROID_LOG_INFO,
75.87 + ANDROID_LOG_WARN,
75.88 + ANDROID_LOG_ERROR,
75.89 + ANDROID_LOG_FATAL
75.90 +};
75.91 +#endif /* __ANDROID__ */
75.92 +
75.93 +
75.94 +void
75.95 +SDL_LogSetAllPriority(SDL_LogPriority priority)
75.96 +{
75.97 + SDL_LogLevel *entry;
75.98 +
75.99 + for (entry = SDL_loglevels; entry; entry = entry->next) {
75.100 + entry->priority = priority;
75.101 + }
75.102 + SDL_application_priority = SDL_default_priority = priority;
75.103 +}
75.104 +
75.105 +void
75.106 +SDL_LogSetPriority(int category, SDL_LogPriority priority)
75.107 +{
75.108 + SDL_LogLevel *entry;
75.109 +
75.110 + for (entry = SDL_loglevels; entry; entry = entry->next) {
75.111 + if (entry->category == category) {
75.112 + entry->priority = priority;
75.113 + return;
75.114 + }
75.115 + }
75.116 +
75.117 + /* Create a new entry */
75.118 + entry = (SDL_LogLevel *)SDL_malloc(sizeof(*entry));
75.119 + if (entry) {
75.120 + entry->category = category;
75.121 + entry->priority = priority;
75.122 + entry->next = SDL_loglevels;
75.123 + SDL_loglevels = entry;
75.124 + }
75.125 +}
75.126 +
75.127 +SDL_LogPriority
75.128 +SDL_LogGetPriority(int category)
75.129 +{
75.130 + SDL_LogLevel *entry;
75.131 +
75.132 + for (entry = SDL_loglevels; entry; entry = entry->next) {
75.133 + if (entry->category == category) {
75.134 + return entry->priority;
75.135 + }
75.136 + }
75.137 +
75.138 + if (category == SDL_LOG_CATEGORY_APPLICATION) {
75.139 + return SDL_application_priority;
75.140 + } else {
75.141 + return SDL_default_priority;
75.142 + }
75.143 +}
75.144 +
75.145 +void
75.146 +SDL_LogResetPriorities(void)
75.147 +{
75.148 + SDL_LogLevel *entry;
75.149 +
75.150 + while (SDL_loglevels) {
75.151 + entry = SDL_loglevels;
75.152 + SDL_loglevels = entry->next;
75.153 + SDL_free(entry);
75.154 + }
75.155 +
75.156 + SDL_application_priority = DEFAULT_APPLICATION_PRIORITY;
75.157 + SDL_default_priority = DEFAULT_PRIORITY;
75.158 +}
75.159 +
75.160 +void
75.161 +SDL_Log(const char *fmt, ...)
75.162 +{
75.163 + va_list ap;
75.164 +
75.165 + va_start(ap, fmt);
75.166 + SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap);
75.167 + va_end(ap);
75.168 +}
75.169 +
75.170 +void
75.171 +SDL_LogVerbose(int category, const char *fmt, ...)
75.172 +{
75.173 + va_list ap;
75.174 +
75.175 + va_start(ap, fmt);
75.176 + SDL_LogMessageV(category, SDL_LOG_PRIORITY_VERBOSE, fmt, ap);
75.177 + va_end(ap);
75.178 +}
75.179 +
75.180 +void
75.181 +SDL_LogInfo(int category, const char *fmt, ...)
75.182 +{
75.183 + va_list ap;
75.184 +
75.185 + va_start(ap, fmt);
75.186 + SDL_LogMessageV(category, SDL_LOG_PRIORITY_INFO, fmt, ap);
75.187 + va_end(ap);
75.188 +}
75.189 +
75.190 +void
75.191 +SDL_LogWarn(int category, const char *fmt, ...)
75.192 +{
75.193 + va_list ap;
75.194 +
75.195 + va_start(ap, fmt);
75.196 + SDL_LogMessageV(category, SDL_LOG_PRIORITY_WARN, fmt, ap);
75.197 + va_end(ap);
75.198 +}
75.199 +
75.200 +void
75.201 +SDL_LogError(int category, const char *fmt, ...)
75.202 +{
75.203 + va_list ap;
75.204 +
75.205 + va_start(ap, fmt);
75.206 + SDL_LogMessageV(category, SDL_LOG_PRIORITY_ERROR, fmt, ap);
75.207 + va_end(ap);
75.208 +}
75.209 +
75.210 +void
75.211 +SDL_LogCritical(int category, const char *fmt, ...)
75.212 +{
75.213 + va_list ap;
75.214 +
75.215 + va_start(ap, fmt);
75.216 + SDL_LogMessageV(category, SDL_LOG_PRIORITY_CRITICAL, fmt, ap);
75.217 + va_end(ap);
75.218 +}
75.219 +
75.220 +void
75.221 +SDL_LogMessage(int category, SDL_LogPriority priority, const char *fmt, ...)
75.222 +{
75.223 + va_list ap;
75.224 +
75.225 + va_start(ap, fmt);
75.226 + SDL_LogMessageV(category, priority, fmt, ap);
75.227 + va_end(ap);
75.228 +}
75.229 +
75.230 +#ifdef __ANDROID__
75.231 +static const char *
75.232 +GetCategoryPrefix(int category)
75.233 +{
75.234 + if (category < SDL_LOG_CATEGORY_RESERVED1) {
75.235 + return SDL_category_prefixes[category];
75.236 + }
75.237 + if (category < SDL_LOG_CATEGORY_CUSTOM) {
75.238 + return "RESERVED";
75.239 + }
75.240 + return "CUSTOM";
75.241 +}
75.242 +#endif /* __ANDROID__ */
75.243 +
75.244 +void
75.245 +SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list ap)
75.246 +{
75.247 + char *message;
75.248 +
75.249 + /* Nothing to do if we don't have an output function */
75.250 + if (!SDL_log_function) {
75.251 + return;
75.252 + }
75.253 +
75.254 + /* Make sure we don't exceed array bounds */
75.255 + if (priority < 0 || priority >= SDL_NUM_LOG_PRIORITIES) {
75.256 + return;
75.257 + }
75.258 +
75.259 + /* See if we want to do anything with this message */
75.260 + if (priority < SDL_LogGetPriority(category)) {
75.261 + return;
75.262 + }
75.263 +
75.264 + message = SDL_stack_alloc(char, SDL_MAX_LOG_MESSAGE);
75.265 + if (!message) {
75.266 + return;
75.267 + }
75.268 + SDL_vsnprintf(message, SDL_MAX_LOG_MESSAGE, fmt, ap);
75.269 + SDL_log_function(SDL_log_userdata, category, priority, message);
75.270 + SDL_stack_free(message);
75.271 +}
75.272 +
75.273 +static void
75.274 +SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
75.275 + const char *message)
75.276 +{
75.277 +#if defined(__WIN32__)
75.278 + /* Way too many allocations here, urgh */
75.279 + {
75.280 + char *output;
75.281 + size_t length;
75.282 + LPTSTR tstr;
75.283 +
75.284 + length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 1;
75.285 + output = SDL_stack_alloc(char, length);
75.286 + SDL_snprintf(output, length, "%s: %s", SDL_priority_prefixes[priority], message);
75.287 + tstr = WIN_UTF8ToString(output);
75.288 + OutputDebugString(tstr);
75.289 + SDL_free(tstr);
75.290 + SDL_stack_free(output);
75.291 + }
75.292 +#elif defined(__ANDROID__)
75.293 + {
75.294 + char tag[32];
75.295 +
75.296 + SDL_snprintf(tag, SDL_arraysize(tag), "SDL/%s", GetCategoryPrefix(category));
75.297 + __android_log_write(SDL_android_priority[priority], tag, message);
75.298 + }
75.299 +#endif
75.300 +#if HAVE_STDIO_H
75.301 + fprintf(stderr, "%s: %s\n", SDL_priority_prefixes[priority], message);
75.302 +#endif
75.303 +}
75.304 +
75.305 +void
75.306 +SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata)
75.307 +{
75.308 + if (callback) {
75.309 + *callback = SDL_log_function;
75.310 + }
75.311 + if (userdata) {
75.312 + *userdata = SDL_log_userdata;
75.313 + }
75.314 +}
75.315 +
75.316 +void
75.317 +SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata)
75.318 +{
75.319 + SDL_log_function = callback;
75.320 + SDL_log_userdata = userdata;
75.321 +}
75.322 +
75.323 +/* vi: set ts=4 sw=4 expandtab: */
76.1 --- a/src/atomic/SDL_atomic.c Sun Feb 06 23:48:31 2011 -0800
76.2 +++ b/src/atomic/SDL_atomic.c Sat Feb 12 19:16:09 2011 -0800
76.3 @@ -1,6 +1,6 @@
76.4 /*
76.5 SDL - Simple DirectMedia Layer
76.6 - Copyright (C) 1997-2010 Sam Lantinga
76.7 + Copyright (C) 1997-2011 Sam Lantinga
76.8
76.9 This library is free software; you can redistribute it and/or
76.10 modify it under the terms of the GNU Lesser General Public
77.1 --- a/src/atomic/SDL_spinlock.c Sun Feb 06 23:48:31 2011 -0800
77.2 +++ b/src/atomic/SDL_spinlock.c Sat Feb 12 19:16:09 2011 -0800
77.3 @@ -1,6 +1,6 @@
77.4 /*
77.5 SDL - Simple DirectMedia Layer
77.6 - Copyright (C) 1997-2010 Sam Lantinga
77.7 + Copyright (C) 1997-2011 Sam Lantinga
77.8
77.9 This library is free software; you can redistribute it and/or
77.10 modify it under the terms of the GNU Lesser General Public
77.11 @@ -22,6 +22,7 @@
77.12 #include "SDL_stdinc.h"
77.13
77.14 #include "SDL_atomic.h"
77.15 +#include "SDL_mutex.h"
77.16 #include "SDL_timer.h"
77.17
77.18 /* Don't do the check for Visual Studio 2005, it's safe here */
77.19 @@ -33,7 +34,25 @@
77.20 SDL_bool
77.21 SDL_AtomicTryLock(SDL_SpinLock *lock)
77.22 {
77.23 -#if defined(_MSC_VER)
77.24 +#if SDL_ATOMIC_DISABLED
77.25 + /* Terrible terrible damage */
77.26 + static SDL_mutex *_spinlock_mutex;
77.27 +
77.28 + if (!_spinlock_mutex) {
77.29 + /* Race condition on first lock... */
77.30 + _spinlock_mutex = SDL_CreateMutex();
77.31 + }
77.32 + SDL_mutexP(_spinlock_mutex);
77.33 + if (*lock == 0) {
77.34 + *lock = 1;
77.35 + SDL_mutexV(_spinlock_mutex);
77.36 + return SDL_TRUE;
77.37 + } else {
77.38 + SDL_mutexV(_spinlock_mutex);
77.39 + return SDL_FALSE;
77.40 + }
77.41 +
77.42 +#elif defined(_MSC_VER)
77.43 SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long));
77.44 return (InterlockedExchange((long*)lock, 1) == 0);
77.45
78.1 --- a/src/audio/SDL_audio.c Sun Feb 06 23:48:31 2011 -0800
78.2 +++ b/src/audio/SDL_audio.c Sat Feb 12 19:16:09 2011 -0800
78.3 @@ -1,6 +1,6 @@
78.4 /*
78.5 SDL - Simple DirectMedia Layer
78.6 - Copyright (C) 1997-2010 Sam Lantinga
78.7 + Copyright (C) 1997-2011 Sam Lantinga
78.8
78.9 This library is free software; you can redistribute it and/or
78.10 modify it under the terms of the GNU Lesser General Public
79.1 --- a/src/audio/SDL_audio_c.h Sun Feb 06 23:48:31 2011 -0800
79.2 +++ b/src/audio/SDL_audio_c.h Sat Feb 12 19:16:09 2011 -0800
79.3 @@ -1,6 +1,6 @@
79.4 /*
79.5 SDL - Simple DirectMedia Layer
79.6 - Copyright (C) 1997-2010 Sam Lantinga
79.7 + Copyright (C) 1997-2011 Sam Lantinga
79.8
79.9 This library is free software; you can redistribute it and/or
79.10 modify it under the terms of the GNU Lesser General Public
80.1 --- a/src/audio/SDL_audiocvt.c Sun Feb 06 23:48:31 2011 -0800
80.2 +++ b/src/audio/SDL_audiocvt.c Sat Feb 12 19:16:09 2011 -0800
80.3 @@ -1,6 +1,6 @@
80.4 /*
80.5 SDL - Simple DirectMedia Layer
80.6 - Copyright (C) 1997-2010 Sam Lantinga
80.7 + Copyright (C) 1997-2011 Sam Lantinga
80.8
80.9 This library is free software; you can redistribute it and/or
80.10 modify it under the terms of the GNU Lesser General Public
81.1 --- a/src/audio/SDL_audiodev.c Sun Feb 06 23:48:31 2011 -0800
81.2 +++ b/src/audio/SDL_audiodev.c Sat Feb 12 19:16:09 2011 -0800
81.3 @@ -1,6 +1,6 @@
81.4 /*
81.5 SDL - Simple DirectMedia Layer
81.6 - Copyright (C) 1997-2010 Sam Lantinga
81.7 + Copyright (C) 1997-2011 Sam Lantinga
81.8
81.9 This library is free software; you can redistribute it and/or
81.10 modify it under the terms of the GNU Lesser General Public
82.1 --- a/src/audio/SDL_audiodev_c.h Sun Feb 06 23:48:31 2011 -0800
82.2 +++ b/src/audio/SDL_audiodev_c.h Sat Feb 12 19:16:09 2011 -0800
82.3 @@ -1,6 +1,6 @@
82.4 /*
82.5 SDL - Simple DirectMedia Layer
82.6 - Copyright (C) 1997-2010 Sam Lantinga
82.7 + Copyright (C) 1997-2011 Sam Lantinga
82.8
82.9 This library is free software; you can redistribute it and/or
82.10 modify it under the terms of the GNU Lesser General Public
83.1 --- a/src/audio/SDL_audiomem.h Sun Feb 06 23:48:31 2011 -0800
83.2 +++ b/src/audio/SDL_audiomem.h Sat Feb 12 19:16:09 2011 -0800
83.3 @@ -1,6 +1,6 @@
83.4 /*
83.5 SDL - Simple DirectMedia Layer
83.6 - Copyright (C) 1997-2010 Sam Lantinga
83.7 + Copyright (C) 1997-2011 Sam Lantinga
83.8
83.9 This library is free software; you can redistribute it and/or
83.10 modify it under the terms of the GNU Lesser General Public
84.1 --- a/src/audio/SDL_audiotypecvt.c Sun Feb 06 23:48:31 2011 -0800
84.2 +++ b/src/audio/SDL_audiotypecvt.c Sat Feb 12 19:16:09 2011 -0800
84.3 @@ -1,7 +1,7 @@
84.4 /* DO NOT EDIT! This file is generated by sdlgenaudiocvt.pl */
84.5 /*
84.6 SDL - Simple DirectMedia Layer
84.7 - Copyright (C) 1997-2010 Sam Lantinga
84.8 + Copyright (C) 1997-2011 Sam Lantinga
84.9
84.10 This library is free software; you can redistribute it and/or
84.11 modify it under the terms of the GNU Lesser General Public
85.1 --- a/src/audio/SDL_mixer.c Sun Feb 06 23:48:31 2011 -0800
85.2 +++ b/src/audio/SDL_mixer.c Sat Feb 12 19:16:09 2011 -0800
85.3 @@ -1,6 +1,6 @@
85.4 /*
85.5 SDL - Simple DirectMedia Layer
85.6 - Copyright (C) 1997-2010 Sam Lantinga
85.7 + Copyright (C) 1997-2011 Sam Lantinga
85.8
85.9 This library is free software; you can redistribute it and/or
85.10 modify it under the terms of the GNU Lesser General Public
86.1 --- a/src/audio/SDL_mixer_MMX.c Sun Feb 06 23:48:31 2011 -0800
86.2 +++ b/src/audio/SDL_mixer_MMX.c Sat Feb 12 19:16:09 2011 -0800
86.3 @@ -1,6 +1,6 @@
86.4 /*
86.5 SDL - Simple DirectMedia Layer
86.6 - Copyright (C) 1997-2010 Sam Lantinga
86.7 + Copyright (C) 1997-2011 Sam Lantinga
86.8
86.9 This library is free software; you can redistribute it and/or
86.10 modify it under the terms of the GNU Lesser General Public
87.1 --- a/src/audio/SDL_mixer_MMX_VC.c Sun Feb 06 23:48:31 2011 -0800
87.2 +++ b/src/audio/SDL_mixer_MMX_VC.c Sat Feb 12 19:16:09 2011 -0800
87.3 @@ -1,6 +1,6 @@
87.4 /*
87.5 SDL - Simple DirectMedia Layer
87.6 - Copyright (C) 1997-2010 Sam Lantinga
87.7 + Copyright (C) 1997-2011 Sam Lantinga
87.8
87.9 This library is free software; you can redistribute it and/or
87.10 modify it under the terms of the GNU Lesser General Public
88.1 --- a/src/audio/SDL_mixer_MMX_VC.h Sun Feb 06 23:48:31 2011 -0800
88.2 +++ b/src/audio/SDL_mixer_MMX_VC.h Sat Feb 12 19:16:09 2011 -0800
88.3 @@ -1,6 +1,6 @@
88.4 /*
88.5 SDL - Simple DirectMedia Layer
88.6 - Copyright (C) 1997-2010 Sam Lantinga
88.7 + Copyright (C) 1997-2011 Sam Lantinga
88.8
88.9 This library is free software; you can redistribute it and/or
88.10 modify it under the terms of the GNU Lesser General Public
89.1 --- a/src/audio/SDL_mixer_m68k.c Sun Feb 06 23:48:31 2011 -0800
89.2 +++ b/src/audio/SDL_mixer_m68k.c Sat Feb 12 19:16:09 2011 -0800
89.3 @@ -1,6 +1,6 @@
89.4 /*
89.5 SDL - Simple DirectMedia Layer
89.6 - Copyright (C) 1997-2010 Sam Lantinga
89.7 + Copyright (C) 1997-2011 Sam Lantinga
89.8
89.9 This library is free software; you can redistribute it and/or
89.10 modify it under the terms of the GNU Lesser General Public
90.1 --- a/src/audio/SDL_mixer_m68k.h Sun Feb 06 23:48:31 2011 -0800
90.2 +++ b/src/audio/SDL_mixer_m68k.h Sat Feb 12 19:16:09 2011 -0800
90.3 @@ -1,6 +1,6 @@
90.4 /*
90.5 SDL - Simple DirectMedia Layer
90.6 - Copyright (C) 1997-2010 Sam Lantinga
90.7 + Copyright (C) 1997-2011 Sam Lantinga
90.8
90.9 This library is free software; you can redistribute it and/or
90.10 modify it under the terms of the GNU Lesser General Public
91.1 --- a/src/audio/SDL_sysaudio.h Sun Feb 06 23:48:31 2011 -0800
91.2 +++ b/src/audio/SDL_sysaudio.h Sat Feb 12 19:16:09 2011 -0800
91.3 @@ -1,6 +1,6 @@
91.4 /*
91.5 SDL - Simple DirectMedia Layer
91.6 - Copyright (C) 1997-2010 Sam Lantinga
91.7 + Copyright (C) 1997-2011 Sam Lantinga
91.8
91.9 This library is SDL_free software; you can redistribute it and/or
91.10 modify it under the terms of the GNU Lesser General Public
92.1 --- a/src/audio/SDL_wave.c Sun Feb 06 23:48:31 2011 -0800
92.2 +++ b/src/audio/SDL_wave.c Sat Feb 12 19:16:09 2011 -0800
92.3 @@ -1,6 +1,6 @@
92.4 /*
92.5 SDL - Simple DirectMedia Layer
92.6 - Copyright (C) 1997-2010 Sam Lantinga
92.7 + Copyright (C) 1997-2011 Sam Lantinga
92.8
92.9 This library is free software; you can redistribute it and/or
92.10 modify it under the terms of the GNU Lesser General Public
93.1 --- a/src/audio/SDL_wave.h Sun Feb 06 23:48:31 2011 -0800
93.2 +++ b/src/audio/SDL_wave.h Sat Feb 12 19:16:09 2011 -0800
93.3 @@ -1,6 +1,6 @@
93.4 /*
93.5 SDL - Simple DirectMedia Layer
93.6 - Copyright (C) 1997-2010 Sam Lantinga
93.7 + Copyright (C) 1997-2011 Sam Lantinga
93.8
93.9 This library is SDL_free software; you can redistribute it and/or
93.10 modify it under the terms of the GNU Lesser General Public
94.1 --- a/src/audio/alsa/SDL_alsa_audio.c Sun Feb 06 23:48:31 2011 -0800
94.2 +++ b/src/audio/alsa/SDL_alsa_audio.c Sat Feb 12 19:16:09 2011 -0800
94.3 @@ -1,6 +1,6 @@
94.4 /*
94.5 SDL - Simple DirectMedia Layer
94.6 - Copyright (C) 1997-2010 Sam Lantinga
94.7 + Copyright (C) 1997-2011 Sam Lantinga
94.8
94.9 This library is free software; you can redistribute it and/or
94.10 modify it under the terms of the GNU Lesser General Public
95.1 --- a/src/audio/alsa/SDL_alsa_audio.h Sun Feb 06 23:48:31 2011 -0800
95.2 +++ b/src/audio/alsa/SDL_alsa_audio.h Sat Feb 12 19:16:09 2011 -0800
95.3 @@ -1,6 +1,6 @@
95.4 /*
95.5 SDL - Simple DirectMedia Layer
95.6 - Copyright (C) 1997-2010 Sam Lantinga
95.7 + Copyright (C) 1997-2011 Sam Lantinga
95.8
95.9 This library is free software; you can redistribute it and/or
95.10 modify it under the terms of the GNU Lesser General Public
96.1 --- a/src/audio/android/SDL_androidaudio.c Sun Feb 06 23:48:31 2011 -0800
96.2 +++ b/src/audio/android/SDL_androidaudio.c Sat Feb 12 19:16:09 2011 -0800
96.3 @@ -1,6 +1,6 @@
96.4 /*
96.5 SDL - Simple DirectMedia Layer
96.6 - Copyright (C) 1997-2010 Sam Lantinga
96.7 + Copyright (C) 1997-2011 Sam Lantinga
96.8
96.9 This library is free software; you can redistribute it and/or
96.10 modify it under the terms of the GNU Lesser General Public
97.1 --- a/src/audio/android/SDL_androidaudio.h Sun Feb 06 23:48:31 2011 -0800
97.2 +++ b/src/audio/android/SDL_androidaudio.h Sat Feb 12 19:16:09 2011 -0800
97.3 @@ -1,6 +1,6 @@
97.4 /*
97.5 SDL - Simple DirectMedia Layer
97.6 - Copyright (C) 1997-2010 Sam Lantinga
97.7 + Copyright (C) 1997-2011 Sam Lantinga
97.8
97.9 This library is free software; you can redistribute it and/or
97.10 modify it under the terms of the GNU Lesser General Public
98.1 --- a/src/audio/arts/SDL_artsaudio.c Sun Feb 06 23:48:31 2011 -0800
98.2 +++ b/src/audio/arts/SDL_artsaudio.c Sat Feb 12 19:16:09 2011 -0800
98.3 @@ -1,6 +1,6 @@
98.4 /*
98.5 SDL - Simple DirectMedia Layer
98.6 - Copyright (C) 1997-2010 Sam Lantinga
98.7 + Copyright (C) 1997-2011 Sam Lantinga
98.8
98.9 This library is free software; you can redistribute it and/or
98.10 modify it under the terms of the GNU Lesser General Public
99.1 --- a/src/audio/arts/SDL_artsaudio.h Sun Feb 06 23:48:31 2011 -0800
99.2 +++ b/src/audio/arts/SDL_artsaudio.h Sat Feb 12 19:16:09 2011 -0800
99.3 @@ -1,6 +1,6 @@
99.4 /*
99.5 SDL - Simple DirectMedia Layer
99.6 - Copyright (C) 1997-2010 Sam Lantinga
99.7 + Copyright (C) 1997-2011 Sam Lantinga
99.8
99.9 This library is free software; you can redistribute it and/or
99.10 modify it under the terms of the GNU Lesser General Public
100.1 --- a/src/audio/baudio/SDL_beaudio.cc Sun Feb 06 23:48:31 2011 -0800
100.2 +++ b/src/audio/baudio/SDL_beaudio.cc Sat Feb 12 19:16:09 2011 -0800
100.3 @@ -1,6 +1,6 @@
100.4 /*
100.5 SDL - Simple DirectMedia Layer
100.6 - Copyright (C) 1997-2009 Sam Lantinga
100.7 + Copyright (C) 1997-2011 Sam Lantinga
100.8
100.9 This library is free software; you can redistribute it and/or
100.10 modify it under the terms of the GNU Lesser General Public
101.1 --- a/src/audio/baudio/SDL_beaudio.h Sun Feb 06 23:48:31 2011 -0800
101.2 +++ b/src/audio/baudio/SDL_beaudio.h Sat Feb 12 19:16:09 2011 -0800
101.3 @@ -1,6 +1,6 @@
101.4 /*
101.5 SDL - Simple DirectMedia Layer
101.6 - Copyright (C) 1997-2010 Sam Lantinga
101.7 + Copyright (C) 1997-2011 Sam Lantinga
101.8
101.9 This library is free software; you can redistribute it and/or
101.10 modify it under the terms of the GNU Lesser General Public
102.1 --- a/src/audio/bsd/SDL_bsdaudio.c Sun Feb 06 23:48:31 2011 -0800
102.2 +++ b/src/audio/bsd/SDL_bsdaudio.c Sat Feb 12 19:16:09 2011 -0800
102.3 @@ -1,6 +1,6 @@
102.4 /*
102.5 SDL - Simple DirectMedia Layer
102.6 - Copyright (C) 1997-2010 Sam Lantinga
102.7 + Copyright (C) 1997-2011 Sam Lantinga
102.8
102.9 This library is free software; you can redistribute it and/or
102.10 modify it under the terms of the GNU Lesser General Public
103.1 --- a/src/audio/bsd/SDL_bsdaudio.h Sun Feb 06 23:48:31 2011 -0800
103.2 +++ b/src/audio/bsd/SDL_bsdaudio.h Sat Feb 12 19:16:09 2011 -0800
103.3 @@ -1,6 +1,6 @@
103.4 /*
103.5 SDL - Simple DirectMedia Layer
103.6 - Copyright (C) 1997-2010 Sam Lantinga
103.7 + Copyright (C) 1997-2011 Sam Lantinga
103.8
103.9 This library is free software; you can redistribute it and/or
103.10 modify it under the terms of the GNU Lesser General Public
104.1 --- a/src/audio/disk/SDL_diskaudio.c Sun Feb 06 23:48:31 2011 -0800
104.2 +++ b/src/audio/disk/SDL_diskaudio.c Sat Feb 12 19:16:09 2011 -0800
104.3 @@ -1,6 +1,6 @@
104.4 /*
104.5 SDL - Simple DirectMedia Layer
104.6 - Copyright (C) 1997-2010 Sam Lantinga
104.7 + Copyright (C) 1997-2011 Sam Lantinga
104.8
104.9 This library is free software; you can redistribute it and/or
104.10 modify it under the terms of the GNU Lesser General Public
105.1 --- a/src/audio/disk/SDL_diskaudio.h Sun Feb 06 23:48:31 2011 -0800
105.2 +++ b/src/audio/disk/SDL_diskaudio.h Sat Feb 12 19:16:09 2011 -0800
105.3 @@ -1,6 +1,6 @@
105.4 /*
105.5 SDL - Simple DirectMedia Layer
105.6 - Copyright (C) 1997-2010 Sam Lantinga
105.7 + Copyright (C) 1997-2011 Sam Lantinga
105.8
105.9 This library is free software; you can redistribute it and/or
105.10 modify it under the terms of the GNU Lesser General Public
106.1 --- a/src/audio/dma/SDL_dmaaudio.c Sun Feb 06 23:48:31 2011 -0800
106.2 +++ b/src/audio/dma/SDL_dmaaudio.c Sat Feb 12 19:16:09 2011 -0800
106.3 @@ -1,6 +1,6 @@
106.4 /*
106.5 SDL - Simple DirectMedia Layer
106.6 - Copyright (C) 1997-2010 Sam Lantinga
106.7 + Copyright (C) 1997-2011 Sam Lantinga
106.8
106.9 This library is free software; you can redistribute it and/or
106.10 modify it under the terms of the GNU Lesser General Public
107.1 --- a/src/audio/dma/SDL_dmaaudio.h Sun Feb 06 23:48:31 2011 -0800
107.2 +++ b/src/audio/dma/SDL_dmaaudio.h Sat Feb 12 19:16:09 2011 -0800
107.3 @@ -1,6 +1,6 @@
107.4 /*
107.5 SDL - Simple DirectMedia Layer
107.6 - Copyright (C) 1997-2010 Sam Lantinga
107.7 + Copyright (C) 1997-2011 Sam Lantinga
107.8
107.9 This library is free software; you can redistribute it and/or
107.10 modify it under the terms of the GNU Lesser General Public
108.1 --- a/src/audio/dmedia/SDL_irixaudio.c Sun Feb 06 23:48:31 2011 -0800
108.2 +++ b/src/audio/dmedia/SDL_irixaudio.c Sat Feb 12 19:16:09 2011 -0800
108.3 @@ -1,6 +1,6 @@
108.4 /*
108.5 SDL - Simple DirectMedia Layer
108.6 - Copyright (C) 1997-2010 Sam Lantinga
108.7 + Copyright (C) 1997-2011 Sam Lantinga
108.8
108.9 This library is free software; you can redistribute it and/or
108.10 modify it under the terms of the GNU Lesser General Public
109.1 --- a/src/audio/dmedia/SDL_irixaudio.h Sun Feb 06 23:48:31 2011 -0800
109.2 +++ b/src/audio/dmedia/SDL_irixaudio.h Sat Feb 12 19:16:09 2011 -0800
109.3 @@ -1,6 +1,6 @@
109.4 /*
109.5 SDL - Simple DirectMedia Layer
109.6 - Copyright (C) 1997-2010 Sam Lantinga
109.7 + Copyright (C) 1997-2011 Sam Lantinga
109.8
109.9 This library is free software; you can redistribute it and/or
109.10 modify it under the terms of the GNU Lesser General Public
110.1 --- a/src/audio/dsp/SDL_dspaudio.c Sun Feb 06 23:48:31 2011 -0800
110.2 +++ b/src/audio/dsp/SDL_dspaudio.c Sat Feb 12 19:16:09 2011 -0800
110.3 @@ -1,6 +1,6 @@
110.4 /*
110.5 SDL - Simple DirectMedia Layer
110.6 - Copyright (C) 1997-2010 Sam Lantinga
110.7 + Copyright (C) 1997-2011 Sam Lantinga
110.8
110.9 This library is free software; you can redistribute it and/or
110.10 modify it under the terms of the GNU Lesser General Public
111.1 --- a/src/audio/dsp/SDL_dspaudio.h Sun Feb 06 23:48:31 2011 -0800
111.2 +++ b/src/audio/dsp/SDL_dspaudio.h Sat Feb 12 19:16:09 2011 -0800
111.3 @@ -1,6 +1,6 @@
111.4 /*
111.5 SDL - Simple DirectMedia Layer
111.6 - Copyright (C) 1997-2010 Sam Lantinga
111.7 + Copyright (C) 1997-2011 Sam Lantinga
111.8
111.9 This library is free software; you can redistribute it and/or
111.10 modify it under the terms of the GNU Lesser General Public
112.1 --- a/src/audio/dummy/SDL_dummyaudio.c Sun Feb 06 23:48:31 2011 -0800
112.2 +++ b/src/audio/dummy/SDL_dummyaudio.c Sat Feb 12 19:16:09 2011 -0800
112.3 @@ -1,6 +1,6 @@
112.4 /*
112.5 SDL - Simple DirectMedia Layer
112.6 - Copyright (C) 1997-2010 Sam Lantinga
112.7 + Copyright (C) 1997-2011 Sam Lantinga
112.8
112.9 This library is free software; you can redistribute it and/or
112.10 modify it under the terms of the GNU Lesser General Public
113.1 --- a/src/audio/dummy/SDL_dummyaudio.h Sun Feb 06 23:48:31 2011 -0800
113.2 +++ b/src/audio/dummy/SDL_dummyaudio.h Sat Feb 12 19:16:09 2011 -0800
113.3 @@ -1,6 +1,6 @@
113.4 /*
113.5 SDL - Simple DirectMedia Layer
113.6 - Copyright (C) 1997-2010 Sam Lantinga
113.7 + Copyright (C) 1997-2011 Sam Lantinga
113.8
113.9 This library is free software; you can redistribute it and/or
113.10 modify it under the terms of the GNU Lesser General Public
114.1 --- a/src/audio/esd/SDL_esdaudio.c Sun Feb 06 23:48:31 2011 -0800
114.2 +++ b/src/audio/esd/SDL_esdaudio.c Sat Feb 12 19:16:09 2011 -0800
114.3 @@ -1,6 +1,6 @@
114.4 /*
114.5 SDL - Simple DirectMedia Layer
114.6 - Copyright (C) 1997-2010 Sam Lantinga
114.7 + Copyright (C) 1997-2011 Sam Lantinga
114.8
114.9 This library is free software; you can redistribute it and/or
114.10 modify it under the terms of the GNU Lesser General Public
115.1 --- a/src/audio/esd/SDL_esdaudio.h Sun Feb 06 23:48:31 2011 -0800
115.2 +++ b/src/audio/esd/SDL_esdaudio.h Sat Feb 12 19:16:09 2011 -0800
115.3 @@ -1,6 +1,6 @@
115.4 /*
115.5 SDL - Simple DirectMedia Layer
115.6 - Copyright (C) 1997-2010 Sam Lantinga
115.7 + Copyright (C) 1997-2011 Sam Lantinga
115.8
115.9 This library is free software; you can redistribute it and/or
115.10 modify it under the terms of the GNU Lesser General Public
116.1 --- a/src/audio/fusionsound/SDL_fsaudio.c Sun Feb 06 23:48:31 2011 -0800
116.2 +++ b/src/audio/fusionsound/SDL_fsaudio.c Sat Feb 12 19:16:09 2011 -0800
116.3 @@ -1,6 +1,6 @@
116.4 /*
116.5 SDL - Simple DirectMedia Layer
116.6 - Copyright (C) 1997-2010 Sam Lantinga
116.7 + Copyright (C) 1997-2011 Sam Lantinga
116.8
116.9 This library is free software; you can redistribute it and/or
116.10 modify it under the terms of the GNU Lesser General Public
117.1 --- a/src/audio/fusionsound/SDL_fsaudio.h Sun Feb 06 23:48:31 2011 -0800
117.2 +++ b/src/audio/fusionsound/SDL_fsaudio.h Sat Feb 12 19:16:09 2011 -0800
117.3 @@ -1,6 +1,6 @@
117.4 /*
117.5 SDL - Simple DirectMedia Layer
117.6 - Copyright (C) 1997-2010 Sam Lantinga
117.7 + Copyright (C) 1997-2011 Sam Lantinga
117.8
117.9 This library is free software; you can redistribute it and/or
117.10 modify it under the terms of the GNU Lesser General Public
118.1 --- a/src/audio/iphoneos/SDL_coreaudio_iphone.c Sun Feb 06 23:48:31 2011 -0800
118.2 +++ b/src/audio/iphoneos/SDL_coreaudio_iphone.c Sat Feb 12 19:16:09 2011 -0800
118.3 @@ -1,6 +1,6 @@
118.4 /*
118.5 SDL - Simple DirectMedia Layer
118.6 - Copyright (C) 1997-2010 Sam Lantinga
118.7 + Copyright (C) 1997-2011 Sam Lantinga
118.8
118.9 This library is free software; you can redistribute it and/or
118.10 modify it under the terms of the GNU Lesser General Public
119.1 --- a/src/audio/iphoneos/SDL_coreaudio_iphone.h Sun Feb 06 23:48:31 2011 -0800
119.2 +++ b/src/audio/iphoneos/SDL_coreaudio_iphone.h Sat Feb 12 19:16:09 2011 -0800
119.3 @@ -1,6 +1,6 @@
119.4 /*
119.5 SDL - Simple DirectMedia Layer
119.6 - Copyright (C) 1997-2010 Sam Lantinga
119.7 + Copyright (C) 1997-2011 Sam Lantinga
119.8
119.9 This library is free software; you can redistribute it and/or
119.10 modify it under the terms of the GNU Lesser General Public
120.1 --- a/src/audio/macosx/SDL_coreaudio.c Sun Feb 06 23:48:31 2011 -0800
120.2 +++ b/src/audio/macosx/SDL_coreaudio.c Sat Feb 12 19:16:09 2011 -0800
120.3 @@ -1,6 +1,6 @@
120.4 /*
120.5 SDL - Simple DirectMedia Layer
120.6 - Copyright (C) 1997-2010 Sam Lantinga
120.7 + Copyright (C) 1997-2011 Sam Lantinga
120.8
120.9 This library is free software; you can redistribute it and/or
120.10 modify it under the terms of the GNU Lesser General Public
121.1 --- a/src/audio/macosx/SDL_coreaudio.h Sun Feb 06 23:48:31 2011 -0800
121.2 +++ b/src/audio/macosx/SDL_coreaudio.h Sat Feb 12 19:16:09 2011 -0800
121.3 @@ -1,6 +1,6 @@
121.4 /*
121.5 SDL - Simple DirectMedia Layer
121.6 - Copyright (C) 1997-2010 Sam Lantinga
121.7 + Copyright (C) 1997-2011 Sam Lantinga
121.8
121.9 This library is free software; you can redistribute it and/or
121.10 modify it under the terms of the GNU Lesser General Public
122.1 --- a/src/audio/mme/SDL_mmeaudio.c Sun Feb 06 23:48:31 2011 -0800
122.2 +++ b/src/audio/mme/SDL_mmeaudio.c Sat Feb 12 19:16:09 2011 -0800
122.3 @@ -1,6 +1,6 @@
122.4 /*
122.5 SDL - Simple DirectMedia Layer
122.6 - Copyright (C) 1997-2010 Sam Lantinga
122.7 + Copyright (C) 1997-2011 Sam Lantinga
122.8
122.9 This library is free software; you can redistribute it and/or
122.10 modify it under the terms of the GNU Lesser General Public
123.1 --- a/src/audio/mme/SDL_mmeaudio.h Sun Feb 06 23:48:31 2011 -0800
123.2 +++ b/src/audio/mme/SDL_mmeaudio.h Sat Feb 12 19:16:09 2011 -0800
123.3 @@ -1,6 +1,6 @@
123.4 /*
123.5 SDL - Simple DirectMedia Layer
123.6 - Copyright (C) 1997-2010 Sam Lantinga
123.7 + Copyright (C) 1997-2011 Sam Lantinga
123.8
123.9 This library is free software; you can redistribute it and/or
123.10 modify it under the terms of the GNU Lesser General Public
124.1 --- a/src/audio/nas/SDL_nasaudio.c Sun Feb 06 23:48:31 2011 -0800
124.2 +++ b/src/audio/nas/SDL_nasaudio.c Sat Feb 12 19:16:09 2011 -0800
124.3 @@ -1,6 +1,6 @@
124.4 /*
124.5 SDL - Simple DirectMedia Layer
124.6 - Copyright (C) 1997-2010 Sam Lantinga
124.7 + Copyright (C) 1997-2011 Sam Lantinga
124.8
124.9 This library is free software; you can redistribute it and/or
124.10 modify it under the terms of the GNU Lesser General Public
125.1 --- a/src/audio/nas/SDL_nasaudio.h Sun Feb 06 23:48:31 2011 -0800
125.2 +++ b/src/audio/nas/SDL_nasaudio.h Sat Feb 12 19:16:09 2011 -0800
125.3 @@ -1,6 +1,6 @@
125.4 /*
125.5 SDL - Simple DirectMedia Layer
125.6 - Copyright (C) 1997-2010 Sam Lantinga
125.7 + Copyright (C) 1997-2011 Sam Lantinga
125.8
125.9 This library is free software; you can redistribute it and/or
125.10 modify it under the terms of the GNU Lesser General Public
126.1 --- a/src/audio/nds/SDL_ndsaudio.c Sun Feb 06 23:48:31 2011 -0800
126.2 +++ b/src/audio/nds/SDL_ndsaudio.c Sat Feb 12 19:16:09 2011 -0800
126.3 @@ -1,6 +1,6 @@
126.4 /*
126.5 SDL - Simple DirectMedia Layer
126.6 - Copyright (C) 1997-2010 Sam Lantinga
126.7 + Copyright (C) 1997-2011 Sam Lantinga
126.8
126.9 This library is free software; you can redistribute it and/or
126.10 modify it under the terms of the GNU Lesser General Public
126.11 @@ -57,11 +57,13 @@
126.12 }
126.13 }
126.14
126.15 +#if 0
126.16 /* set the generic sound parameters */
126.17 setGenericSound(22050, /* sample rate */
126.18 127, /* volume */
126.19 64, /* panning/balance */
126.20 0); /* sound format */
126.21 +#endif
126.22
126.23 return 1;
126.24 }
126.25 @@ -69,13 +71,9 @@
126.26 static void
126.27 NDSAUD_PlayDevice(_THIS)
126.28 {
126.29 - TransferSoundData *sound = SDL_malloc(sizeof(TransferSoundData));
126.30 - if (!sound) {
126.31 - SDL_OutOfMemory();
126.32 - }
126.33 +#if 0
126.34 + playGenericSound(this->hidden->mixbuf, this->hidden->mixlen);
126.35
126.36 - playGenericSound(this->hidden->mixbuf, this->hidden->mixlen);
126.37 -#if 0
126.38 // sound->data = this->hidden->mixbuf;/* pointer to raw audio data */
126.39 // sound->len = this->hidden->mixlen; /* size of raw data pointed to above */
126.40 // sound->rate = 22050; /* sample rate = 22050Hz */
127.1 --- a/src/audio/nds/SDL_ndsaudio.h Sun Feb 06 23:48:31 2011 -0800
127.2 +++ b/src/audio/nds/SDL_ndsaudio.h Sat Feb 12 19:16:09 2011 -0800
127.3 @@ -1,6 +1,6 @@
127.4 /*
127.5 SDL - Simple DirectMedia Layer
127.6 - Copyright (C) 1997-2010 Sam Lantinga
127.7 + Copyright (C) 1997-2011 Sam Lantinga
127.8
127.9 This library is free software; you can redistribute it and/or
127.10 modify it under the terms of the GNU Lesser General Public
127.11 @@ -32,7 +32,6 @@
127.12
127.13 struct SDL_PrivateAudioData
127.14 {
127.15 - TransferSoundData *sound;
127.16 /* The file descriptor for the audio device */
127.17 Uint8 *mixbuf;
127.18 Uint32 mixlen;
128.1 --- a/src/audio/paudio/SDL_paudio.c Sun Feb 06 23:48:31 2011 -0800
128.2 +++ b/src/audio/paudio/SDL_paudio.c Sat Feb 12 19:16:09 2011 -0800
128.3 @@ -1,6 +1,6 @@
128.4 /*
128.5 SDL - Simple DirectMedia Layer
128.6 - Copyright (C) 1997-2010 Sam Lantinga
128.7 + Copyright (C) 1997-2011 Sam Lantinga
128.8
128.9 This library is free software; you can redistribute it and/or
128.10 modify it under the terms of the GNU Lesser General Public
129.1 --- a/src/audio/paudio/SDL_paudio.h Sun Feb 06 23:48:31 2011 -0800
129.2 +++ b/src/audio/paudio/SDL_paudio.h Sat Feb 12 19:16:09 2011 -0800
129.3 @@ -1,6 +1,6 @@
129.4 /*
129.5 SDL - Simple DirectMedia Layer
129.6 - Copyright (C) 1997-2010 Sam Lantinga
129.7 + Copyright (C) 1997-2011 Sam Lantinga
129.8
129.9 This library is free software; you can redistribute it and/or
129.10 modify it under the terms of the GNU Lesser General Public
130.1 --- a/src/audio/pulseaudio/SDL_pulseaudio.c Sun Feb 06 23:48:31 2011 -0800
130.2 +++ b/src/audio/pulseaudio/SDL_pulseaudio.c Sat Feb 12 19:16:09 2011 -0800
130.3 @@ -1,6 +1,6 @@
130.4 /*
130.5 SDL - Simple DirectMedia Layer
130.6 - Copyright (C) 1997-2010 Sam Lantinga
130.7 + Copyright (C) 1997-2011 Sam Lantinga
130.8
130.9 This library is free software; you can redistribute it and/or
130.10 modify it under the terms of the GNU Lesser General Public
131.1 --- a/src/audio/pulseaudio/SDL_pulseaudio.h Sun Feb 06 23:48:31 2011 -0800
131.2 +++ b/src/audio/pulseaudio/SDL_pulseaudio.h Sat Feb 12 19:16:09 2011 -0800
131.3 @@ -1,6 +1,6 @@
131.4 /*
131.5 SDL - Simple DirectMedia Layer
131.6 - Copyright (C) 1997-2010 Sam Lantinga
131.7 + Copyright (C) 1997-2011 Sam Lantinga
131.8
131.9 This library is free software; you can redistribute it and/or
131.10 modify it under the terms of the GNU Lesser General Public
132.1 --- a/src/audio/qsa/SDL_qsa_audio.c Sun Feb 06 23:48:31 2011 -0800
132.2 +++ b/src/audio/qsa/SDL_qsa_audio.c Sat Feb 12 19:16:09 2011 -0800
132.3 @@ -1,6 +1,6 @@
132.4 /*
132.5 SDL - Simple DirectMedia Layer
132.6 - Copyright (C) 1997-2010 Sam Lantinga
132.7 + Copyright (C) 1997-2011 Sam Lantinga
132.8
132.9 This library is free software; you can redistribute it and/or
132.10 modify it under the terms of the GNU Lesser General Public
133.1 --- a/src/audio/qsa/SDL_qsa_audio.h Sun Feb 06 23:48:31 2011 -0800
133.2 +++ b/src/audio/qsa/SDL_qsa_audio.h Sat Feb 12 19:16:09 2011 -0800
133.3 @@ -1,6 +1,6 @@
133.4 /*
133.5 SDL - Simple DirectMedia Layer
133.6 - Copyright (C) 1997-2010 Sam Lantinga
133.7 + Copyright (C) 1997-2011 Sam Lantinga
133.8
133.9 This library is free software; you can redistribute it and/or
133.10 modify it under the terms of the GNU Lesser General Public
134.1 --- a/src/audio/sdlgenaudiocvt.pl Sun Feb 06 23:48:31 2011 -0800
134.2 +++ b/src/audio/sdlgenaudiocvt.pl Sat Feb 12 19:16:09 2011 -0800
134.3 @@ -38,7 +38,7 @@
134.4 /* DO NOT EDIT! This file is generated by sdlgenaudiocvt.pl */
134.5 /*
134.6 SDL - Simple DirectMedia Layer
134.7 - Copyright (C) 1997-2010 Sam Lantinga
134.8 + Copyright (C) 1997-2011 Sam Lantinga
134.9
134.10 This library is free software; you can redistribute it and/or
134.11 modify it under the terms of the GNU Lesser General Public
135.1 --- a/src/audio/sun/SDL_sunaudio.c Sun Feb 06 23:48:31 2011 -0800
135.2 +++ b/src/audio/sun/SDL_sunaudio.c Sat Feb 12 19:16:09 2011 -0800
135.3 @@ -5,7 +5,7 @@
135.4
135.5 /*
135.6 SDL - Simple DirectMedia Layer
135.7 - Copyright (C) 1997-2010 Sam Lantinga
135.8 + Copyright (C) 1997-2011 Sam Lantinga
135.9
135.10 This library is free software; you can redistribute it and/or
135.11 modify it under the terms of the GNU Lesser General Public
136.1 --- a/src/audio/sun/SDL_sunaudio.h Sun Feb 06 23:48:31 2011 -0800
136.2 +++ b/src/audio/sun/SDL_sunaudio.h Sat Feb 12 19:16:09 2011 -0800
136.3 @@ -1,6 +1,6 @@
136.4 /*
136.5 SDL - Simple DirectMedia Layer
136.6 - Copyright (C) 1997-2010 Sam Lantinga
136.7 + Copyright (C) 1997-2011 Sam Lantinga
136.8
136.9 This library is free software; you can redistribute it and/or
136.10 modify it under the terms of the GNU Lesser General Public
137.1 --- a/src/audio/ums/SDL_umsaudio.c Sun Feb 06 23:48:31 2011 -0800
137.2 +++ b/src/audio/ums/SDL_umsaudio.c Sat Feb 12 19:16:09 2011 -0800
137.3 @@ -5,7 +5,7 @@
137.4
137.5 /*
137.6 SDL - Simple DirectMedia Layer
137.7 - Copyright (C) 1997-2010 Sam Lantinga
137.8 + Copyright (C) 1997-2011 Sam Lantinga
137.9
137.10 This library is free software; you can redistribute it and/or
137.11 modify it under the terms of the GNU Lesser General Public
138.1 --- a/src/audio/ums/SDL_umsaudio.h Sun Feb 06 23:48:31 2011 -0800
138.2 +++ b/src/audio/ums/SDL_umsaudio.h Sat Feb 12 19:16:09 2011 -0800
138.3 @@ -1,6 +1,6 @@
138.4 /*
138.5 SDL - Simple DirectMedia Layer
138.6 - Copyright (C) 1997-2010 Sam Lantinga
138.7 + Copyright (C) 1997-2011 Sam Lantinga
138.8
138.9 This library is free software; you can redistribute it and/or
138.10 modify it under the terms of the GNU Lesser General Public
139.1 --- a/src/audio/windib/SDL_dibaudio.c Sun Feb 06 23:48:31 2011 -0800
139.2 +++ b/src/audio/windib/SDL_dibaudio.c Sat Feb 12 19:16:09 2011 -0800
139.3 @@ -1,6 +1,6 @@
139.4 /*
139.5 SDL - Simple DirectMedia Layer
139.6 - Copyright (C) 1997-2010 Sam Lantinga
139.7 + Copyright (C) 1997-2011 Sam Lantinga
139.8
139.9 This library is free software; you can redistribute it and/or
139.10 modify it under the terms of the GNU Lesser General Public
140.1 --- a/src/audio/windib/SDL_dibaudio.h Sun Feb 06 23:48:31 2011 -0800
140.2 +++ b/src/audio/windib/SDL_dibaudio.h Sat Feb 12 19:16:09 2011 -0800
140.3 @@ -1,6 +1,6 @@
140.4 /*
140.5 SDL - Simple DirectMedia Layer
140.6 - Copyright (C) 1997-2010 Sam Lantinga
140.7 + Copyright (C) 1997-2011 Sam Lantinga
140.8
140.9 This library is free software; you can redistribute it and/or
140.10 modify it under the terms of the GNU Lesser General Public
141.1 --- a/src/audio/windx5/SDL_dx5audio.c Sun Feb 06 23:48:31 2011 -0800
141.2 +++ b/src/audio/windx5/SDL_dx5audio.c Sat Feb 12 19:16:09 2011 -0800
141.3 @@ -1,6 +1,6 @@
141.4 /*
141.5 SDL - Simple DirectMedia Layer
141.6 - Copyright (C) 1997-2010 Sam Lantinga
141.7 + Copyright (C) 1997-2011 Sam Lantinga
141.8
141.9 This library is free software; you can redistribute it and/or
141.10 modify it under the terms of the GNU Lesser General Public
142.1 --- a/src/audio/windx5/SDL_dx5audio.h Sun Feb 06 23:48:31 2011 -0800
142.2 +++ b/src/audio/windx5/SDL_dx5audio.h Sat Feb 12 19:16:09 2011 -0800
142.3 @@ -1,6 +1,6 @@
142.4 /*
142.5 SDL - Simple DirectMedia Layer
142.6 - Copyright (C) 1997-2010 Sam Lantinga
142.7 + Copyright (C) 1997-2011 Sam Lantinga
142.8
142.9 This library is free software; you can redistribute it and/or
142.10 modify it under the terms of the GNU Lesser General Public
143.1 --- a/src/core/android/SDL_android.cpp Sun Feb 06 23:48:31 2011 -0800
143.2 +++ b/src/core/android/SDL_android.cpp Sat Feb 12 19:16:09 2011 -0800
143.3 @@ -1,6 +1,6 @@
143.4 /*
143.5 SDL - Simple DirectMedia Layer
143.6 - Copyright (C) 1997-2010 Sam Lantinga
143.7 + Copyright (C) 1997-2011 Sam Lantinga
143.8
143.9 This library is free software; you can redistribute it and/or
143.10 modify it under the terms of the GNU Lesser General Public
143.11 @@ -20,6 +20,7 @@
143.12 slouken@libsdl.org
143.13 */
143.14 #include "SDL_config.h"
143.15 +#include "SDL_stdinc.h"
143.16
143.17 #include "SDL_android.h"
143.18
143.19 @@ -80,7 +81,7 @@
143.20 mActivityClass = cls;
143.21
143.22 midCreateGLContext = mEnv->GetStaticMethodID(mActivityClass,
143.23 - "createGLContext","()V");
143.24 + "createGLContext","(II)Z");
143.25 midFlipBuffers = mEnv->GetStaticMethodID(mActivityClass,
143.26 "flipBuffers","()V");
143.27 midAudioInit = mEnv->GetStaticMethodID(mActivityClass,
143.28 @@ -159,9 +160,13 @@
143.29 /*******************************************************************************
143.30 Functions called by SDL into Java
143.31 *******************************************************************************/
143.32 -extern "C" void Android_JNI_CreateContext()
143.33 +extern "C" SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion)
143.34 {
143.35 - mEnv->CallStaticVoidMethod(mActivityClass, midCreateGLContext);
143.36 + if (mEnv->CallStaticBooleanMethod(mActivityClass, midCreateGLContext, majorVersion, minorVersion)) {
143.37 + return SDL_TRUE;
143.38 + } else {
143.39 + return SDL_FALSE;
143.40 + }
143.41 }
143.42
143.43 extern "C" void Android_JNI_SwapWindow()
144.1 --- a/src/core/android/SDL_android.h Sun Feb 06 23:48:31 2011 -0800
144.2 +++ b/src/core/android/SDL_android.h Sat Feb 12 19:16:09 2011 -0800
144.3 @@ -1,6 +1,6 @@
144.4 /*
144.5 SDL - Simple DirectMedia Layer
144.6 - Copyright (C) 1997-2010 Sam Lantinga
144.7 + Copyright (C) 1997-2011 Sam Lantinga
144.8
144.9 This library is free software; you can redistribute it and/or
144.10 modify it under the terms of the GNU Lesser General Public
144.11 @@ -29,7 +29,7 @@
144.12 #endif
144.13
144.14 /* Interface from the SDL library into the Android Java activity */
144.15 -extern void Android_JNI_CreateContext();
144.16 +extern SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion);
144.17 extern void Android_JNI_SwapWindow();
144.18 extern void Android_JNI_SetActivityTitle(const char *title);
144.19 extern void Android_JNI_GetAccelerometerValues(float values[3]);
145.1 --- a/src/core/windows/SDL_windows.c Sun Feb 06 23:48:31 2011 -0800
145.2 +++ b/src/core/windows/SDL_windows.c Sat Feb 12 19:16:09 2011 -0800
145.3 @@ -1,6 +1,6 @@
145.4 /*
145.5 SDL - Simple DirectMedia Layer
145.6 - Copyright (C) 1997-2010 Sam Lantinga
145.7 + Copyright (C) 1997-2011 Sam Lantinga
145.8
145.9 This library is free software; you can redistribute it and/or
145.10 modify it under the terms of the GNU Lesser General Public
146.1 --- a/src/core/windows/SDL_windows.h Sun Feb 06 23:48:31 2011 -0800
146.2 +++ b/src/core/windows/SDL_windows.h Sat Feb 12 19:16:09 2011 -0800
146.3 @@ -1,6 +1,6 @@
146.4 /*
146.5 SDL - Simple DirectMedia Layer
146.6 - Copyright (C) 1997-2010 Sam Lantinga
146.7 + Copyright (C) 1997-2011 Sam Lantinga
146.8
146.9 This library is free software; you can redistribute it and/or
146.10 modify it under the terms of the GNU Lesser General Public
147.1 --- a/src/cpuinfo/SDL_cpuinfo.c Sun Feb 06 23:48:31 2011 -0800
147.2 +++ b/src/cpuinfo/SDL_cpuinfo.c Sat Feb 12 19:16:09 2011 -0800
147.3 @@ -1,6 +1,6 @@
147.4 /*
147.5 SDL - Simple DirectMedia Layer
147.6 - Copyright (C) 1997-2010 Sam Lantinga
147.7 + Copyright (C) 1997-2011 Sam Lantinga
147.8
147.9 This library is free software; you can redistribute it and/or
147.10 modify it under the terms of the GNU Lesser General Public
147.11 @@ -32,36 +32,18 @@
147.12 #include <sys/types.h>
147.13 #include <sys/sysctl.h>
147.14 #endif
147.15 -#if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))
147.16 -#include <sys/sysctl.h> /* For AltiVec check */
147.17 -#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
147.18 -#include <signal.h>
147.19 -#include <setjmp.h>
147.20 -#endif
147.21 #ifdef __WIN32__
147.22 #include "../core/windows/SDL_windows.h"
147.23 #endif
147.24
147.25 #define CPU_HAS_RDTSC 0x00000001
147.26 #define CPU_HAS_MMX 0x00000002
147.27 -#define CPU_HAS_MMXEXT 0x00000004
147.28 -#define CPU_HAS_3DNOW 0x00000010
147.29 -#define CPU_HAS_3DNOWEXT 0x00000020
147.30 -#define CPU_HAS_SSE 0x00000040
147.31 -#define CPU_HAS_SSE2 0x00000080
147.32 -#define CPU_HAS_ALTIVEC 0x00000100
147.33 +#define CPU_HAS_SSE 0x00000010
147.34 +#define CPU_HAS_SSE2 0x00000020
147.35 +#define CPU_HAS_SSE3 0x00000040
147.36 +#define CPU_HAS_SSE41 0x00000080
147.37 +#define CPU_HAS_SSE42 0x00000100
147.38
147.39 -#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__
147.40 -/* This is the brute force way of detecting instruction sets...
147.41 - the idea is borrowed from the libmpeg2 library - thanks!
147.42 - */
147.43 -static jmp_buf jmpbuf;
147.44 -static void
147.45 -illegal_instruction(int sig)
147.46 -{
147.47 - longjmp(jmpbuf, 1);
147.48 -}
147.49 -#endif /* HAVE_SETJMP */
147.50
147.51 static __inline__ int
147.52 CPU_haveCPUID(void)
147.53 @@ -202,20 +184,6 @@
147.54 }
147.55
147.56 static __inline__ int
147.57 -CPU_getCPUIDFeaturesExt(void)
147.58 -{
147.59 - int features = 0;
147.60 - int a, b, c, d;
147.61 -
147.62 - cpuid(0x80000000, a, b, c, d);
147.63 - if (a >= 0x80000001) {
147.64 - cpuid(0x80000001, a, b, c, d);
147.65 - features = d;
147.66 - }
147.67 - return features;
147.68 -}
147.69 -
147.70 -static __inline__ int
147.71 CPU_haveRDTSC(void)
147.72 {
147.73 if (CPU_haveCPUID()) {
147.74 @@ -234,33 +202,6 @@
147.75 }
147.76
147.77 static __inline__ int
147.78 -CPU_haveMMXExt(void)
147.79 -{
147.80 - if (CPU_haveCPUID()) {
147.81 - return (CPU_getCPUIDFeaturesExt() & 0x00400000);
147.82 - }
147.83 - return 0;
147.84 -}
147.85 -
147.86 -static __inline__ int
147.87 -CPU_have3DNow(void)
147.88 -{
147.89 - if (CPU_haveCPUID()) {
147.90 - return (CPU_getCPUIDFeaturesExt() & 0x80000000);
147.91 - }
147.92 - return 0;
147.93 -}
147.94 -
147.95 -static __inline__ int
147.96 -CPU_have3DNowExt(void)
147.97 -{
147.98 - if (CPU_haveCPUID()) {
147.99 - return (CPU_getCPUIDFeaturesExt() & 0x40000000);
147.100 - }
147.101 - return 0;
147.102 -}
147.103 -
147.104 -static __inline__ int
147.105 CPU_haveSSE(void)
147.106 {
147.107 if (CPU_haveCPUID()) {
147.108 @@ -279,26 +220,48 @@
147.109 }
147.110
147.111 static __inline__ int
147.112 -CPU_haveAltiVec(void)
147.113 +CPU_haveSSE3(void)
147.114 +{
147.115 + if (CPU_haveCPUID()) {
147.116 + int a, b, c, d;
147.117 +
147.118 + cpuid(0, a, b, c, d);
147.119 + if (a >= 1) {
147.120 + cpuid(1, a, b, c, d);
147.121 + return (c & 0x00000001);
147.122 + }
147.123 + }
147.124 + return 0;
147.125 +}
147.126 +
147.127 +static __inline__ int
147.128 +CPU_haveSSE41(void)
147.129 {
147.130 - volatile int altivec = 0;
147.131 -#if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))
147.132 - int selectors[2] = { CTL_HW, HW_VECTORUNIT };
147.133 - int hasVectorUnit = 0;
147.134 - size_t length = sizeof(hasVectorUnit);
147.135 - int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0);
147.136 - if (0 == error)
147.137 - altivec = (hasVectorUnit != 0);
147.138 -#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
147.139 - void (*handler) (int sig);
147.140 - handler = signal(SIGILL, illegal_instruction);
147.141 - if (setjmp(jmpbuf) == 0) {
147.142 - asm volatile ("mtspr 256, %0\n\t" "vand %%v0, %%v0, %%v0"::"r" (-1));
147.143 - altivec = 1;
147.144 + if (CPU_haveCPUID()) {
147.145 + int a, b, c, d;
147.146 +
147.147 + cpuid(1, a, b, c, d);
147.148 + if (a >= 1) {
147.149 + cpuid(1, a, b, c, d);
147.150 + return (c & 0x00080000);
147.151 + }
147.152 }
147.153 - signal(SIGILL, handler);
147.154 -#endif
147.155 - return altivec;
147.156 + return 0;
147.157 +}
147.158 +
147.159 +static __inline__ int
147.160 +CPU_haveSSE42(void)
147.161 +{
147.162 + if (CPU_haveCPUID()) {
147.163 + int a, b, c, d;
147.164 +
147.165 + cpuid(1, a, b, c, d);
147.166 + if (a >= 1) {
147.167 + cpuid(1, a, b, c, d);
147.168 + return (c & 0x00100000);
147.169 + }
147.170 + }
147.171 + return 0;
147.172 }
147.173
147.174 static int SDL_CPUCount = 0;
147.175 @@ -471,23 +434,20 @@
147.176 if (CPU_haveMMX()) {
147.177 SDL_CPUFeatures |= CPU_HAS_MMX;
147.178 }
147.179 - if (CPU_haveMMXExt()) {
147.180 - SDL_CPUFeatures |= CPU_HAS_MMXEXT;
147.181 - }
147.182 - if (CPU_have3DNow()) {
147.183 - SDL_CPUFeatures |= CPU_HAS_3DNOW;
147.184 - }
147.185 - if (CPU_have3DNowExt()) {
147.186 - SDL_CPUFeatures |= CPU_HAS_3DNOWEXT;
147.187 - }
147.188 if (CPU_haveSSE()) {
147.189 SDL_CPUFeatures |= CPU_HAS_SSE;
147.190 }
147.191 if (CPU_haveSSE2()) {
147.192 SDL_CPUFeatures |= CPU_HAS_SSE2;
147.193 }
147.194 - if (CPU_haveAltiVec()) {
147.195 - SDL_CPUFeatures |= CPU_HAS_ALTIVEC;
147.196 + if (CPU_haveSSE3()) {
147.197 + SDL_CPUFeatures |= CPU_HAS_SSE3;
147.198 + }
147.199 + if (CPU_haveSSE41()) {
147.200 + SDL_CPUFeatures |= CPU_HAS_SSE41;
147.201 + }
147.202 + if (CPU_haveSSE42()) {
147.203 + SDL_CPUFeatures |= CPU_HAS_SSE42;
147.204 }
147.205 }
147.206 return SDL_CPUFeatures;
147.207 @@ -512,33 +472,6 @@
147.208 }
147.209
147.210 SDL_bool
147.211 -SDL_HasMMXExt(void)
147.212 -{
147.213 - if (SDL_GetCPUFeatures() & CPU_HAS_MMXEXT) {
147.214 - return SDL_TRUE;
147.215 - }
147.216 - return SDL_FALSE;
147.217 -}
147.218 -
147.219 -SDL_bool
147.220 -SDL_Has3DNow(void)
147.221 -{
147.222 - if (SDL_GetCPUFeatures() & CPU_HAS_3DNOW) {
147.223 - return SDL_TRUE;
147.224 - }
147.225 - return SDL_FALSE;
147.226 -}
147.227 -
147.228 -SDL_bool
147.229 -SDL_Has3DNowExt(void)
147.230 -{
147.231 - if (SDL_GetCPUFeatures() & CPU_HAS_3DNOWEXT) {
147.232 - return SDL_TRUE;
147.233 - }
147.234 - return SDL_FALSE;
147.235 -}
147.236 -
147.237 -SDL_bool
147.238 SDL_HasSSE(void)
147.239 {
147.240 if (SDL_GetCPUFeatures() & CPU_HAS_SSE) {
147.241 @@ -557,9 +490,27 @@
147.242 }
147.243
147.244 SDL_bool
147.245 -SDL_HasAltiVec(void)
147.246 +SDL_HasSSE3(void)
147.247 +{
147.248 + if (SDL_GetCPUFeatures() & CPU_HAS_SSE3) {
147.249 + return SDL_TRUE;
147.250 + }
147.251 + return SDL_FALSE;
147.252 +}
147.253 +
147.254 +SDL_bool
147.255 +SDL_HasSSE41(void)
147.256 {
147.257 - if (SDL_GetCPUFeatures() & CPU_HAS_ALTIVEC) {
147.258 + if (SDL_GetCPUFeatures() & CPU_HAS_SSE41) {
147.259 + return SDL_TRUE;
147.260 + }
147.261 + return SDL_FALSE;
147.262 +}
147.263 +
147.264 +SDL_bool
147.265 +SDL_HasSSE42(void)
147.266 +{
147.267 + if (SDL_GetCPUFeatures() & CPU_HAS_SSE42) {
147.268 return SDL_TRUE;
147.269 }
147.270 return SDL_FALSE;
147.271 @@ -578,12 +529,11 @@
147.272 printf("CacheLine size: %d\n", SDL_GetCPUCacheLineSize());
147.273 printf("RDTSC: %d\n", SDL_HasRDTSC());
147.274 printf("MMX: %d\n", SDL_HasMMX());
147.275 - printf("MMXExt: %d\n", SDL_HasMMXExt());
147.276 - printf("3DNow: %d\n", SDL_Has3DNow());
147.277 - printf("3DNowExt: %d\n", SDL_Has3DNowExt());
147.278 printf("SSE: %d\n", SDL_HasSSE());
147.279 printf("SSE2: %d\n", SDL_HasSSE2());
147.280 - printf("AltiVec: %d\n", SDL_HasAltiVec());
147.281 + printf("SSE3: %d\n", SDL_HasSSE3());
147.282 + printf("SSE4.1: %d\n", SDL_HasSSE41());
147.283 + printf("SSE4.2: %d\n", SDL_HasSSE42());
147.284 return 0;
147.285 }
147.286
148.1 --- a/src/events/SDL_clipboardevents.c Sun Feb 06 23:48:31 2011 -0800
148.2 +++ b/src/events/SDL_clipboardevents.c Sat Feb 12 19:16:09 2011 -0800
148.3 @@ -1,6 +1,6 @@
148.4 /*
148.5 SDL - Simple DirectMedia Layer
148.6 - Copyright (C) 1997-2010 Sam Lantinga
148.7 + Copyright (C) 1997-2011 Sam Lantinga
148.8
148.9 This library is free software; you can redistribute it and/or
148.10 modify it under the terms of the GNU Lesser General Public
149.1 --- a/src/events/SDL_clipboardevents_c.h Sun Feb 06 23:48:31 2011 -0800
149.2 +++ b/src/events/SDL_clipboardevents_c.h Sat Feb 12 19:16:09 2011 -0800
149.3 @@ -1,6 +1,6 @@
149.4 /*
149.5 SDL - Simple DirectMedia Layer
149.6 - Copyright (C) 1997-2010 Sam Lantinga
149.7 + Copyright (C) 1997-2011 Sam Lantinga
149.8
149.9 This library is free software; you can redistribute it and/or
149.10 modify it under the terms of the GNU Lesser General Public
150.1 --- a/src/events/SDL_events.c Sun Feb 06 23:48:31 2011 -0800
150.2 +++ b/src/events/SDL_events.c Sat Feb 12 19:16:09 2011 -0800
150.3 @@ -1,6 +1,6 @@
150.4 /*
150.5 SDL - Simple DirectMedia Layer
150.6 - Copyright (C) 1997-2010 Sam Lantinga
150.7 + Copyright (C) 1997-2011 Sam Lantinga
150.8
150.9 This library is free software; you can redistribute it and/or
150.10 modify it under the terms of the GNU Lesser General Public
151.1 --- a/src/events/SDL_events_c.h Sun Feb 06 23:48:31 2011 -0800
151.2 +++ b/src/events/SDL_events_c.h Sat Feb 12 19:16:09 2011 -0800
151.3 @@ -1,6 +1,6 @@
151.4 /*
151.5 SDL - Simple DirectMedia Layer
151.6 - Copyright (C) 1997-2010 Sam Lantinga
151.7 + Copyright (C) 1997-2011 Sam Lantinga
151.8
151.9 This library is free software; you can redistribute it and/or
151.10 modify it under the terms of the GNU Lesser General Public
152.1 --- a/src/events/SDL_gesture.c Sun Feb 06 23:48:31 2011 -0800
152.2 +++ b/src/events/SDL_gesture.c Sat Feb 12 19:16:09 2011 -0800
152.3 @@ -1,6 +1,6 @@
152.4 /*
152.5 SDL - Simple DirectMedia Layer
152.6 - Copyright (C) 1997-2010 Sam Lantinga
152.7 + Copyright (C) 1997-2011 Sam Lantinga
152.8
152.9 This library is free software; you can redistribute it and/or
152.10 modify it under the terms of the GNU Lesser General Public
153.1 --- a/src/events/SDL_gesture_c.h Sun Feb 06 23:48:31 2011 -0800
153.2 +++ b/src/events/SDL_gesture_c.h Sat Feb 12 19:16:09 2011 -0800
153.3 @@ -1,6 +1,6 @@
153.4 /*
153.5 SDL - Simple DirectMedia Layer
153.6 - Copyright (C) 1997-2010 Sam Lantinga
153.7 + Copyright (C) 1997-2011 Sam Lantinga
153.8
153.9 This library is free software; you can redistribute it and/or
153.10 modify it under the terms of the GNU Lesser General Public
154.1 --- a/src/events/SDL_keyboard.c Sun Feb 06 23:48:31 2011 -0800
154.2 +++ b/src/events/SDL_keyboard.c Sat Feb 12 19:16:09 2011 -0800
154.3 @@ -1,6 +1,6 @@
154.4 /*
154.5 SDL - Simple DirectMedia Layer
154.6 - Copyright (C) 1997-2010 Sam Lantinga
154.7 + Copyright (C) 1997-2011 Sam Lantinga
154.8
154.9 This library is free software; you can redistribute it and/or
154.10 modify it under the terms of the GNU Lesser General Public
154.11 @@ -39,12 +39,12 @@
154.12 SDL_Window *focus;
154.13 Uint16 modstate;
154.14 Uint8 keystate[SDL_NUM_SCANCODES];
154.15 - SDLKey keymap[SDL_NUM_SCANCODES];
154.16 + SDL_Keycode keymap[SDL_NUM_SCANCODES];
154.17 };
154.18
154.19 static SDL_Keyboard SDL_keyboard;
154.20
154.21 -static const SDLKey SDL_default_keymap[SDL_NUM_SCANCODES] = {
154.22 +static const SDL_Keycode SDL_default_keymap[SDL_NUM_SCANCODES] = {
154.23 0, 0, 0, 0,
154.24 'a',
154.25 'b',
154.26 @@ -562,7 +562,7 @@
154.27 SDL_ResetKeyboard(void)
154.28 {
154.29 SDL_Keyboard *keyboard = &SDL_keyboard;
154.30 - SDL_ScanCode scancode;
154.31 + SDL_Scancode scancode;
154.32
154.33 for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) {
154.34 if (keyboard->keystate[scancode] == SDL_PRESSED) {
154.35 @@ -572,13 +572,13 @@
154.36 }
154.37
154.38 void
154.39 -SDL_GetDefaultKeymap(SDLKey * keymap)
154.40 +SDL_GetDefaultKeymap(SDL_Keycode * keymap)
154.41 {
154.42 SDL_memcpy(keymap, SDL_default_keymap, sizeof(SDL_default_keymap));
154.43 }
154.44
154.45 void
154.46 -SDL_SetKeymap(int start, SDLKey * keys, int length)
154.47 +SDL_SetKeymap(int start, SDL_Keycode * keys, int length)
154.48 {
154.49 SDL_Keyboard *keyboard = &SDL_keyboard;
154.50
154.51 @@ -590,7 +590,7 @@
154.52 }
154.53
154.54 void
154.55 -SDL_SetScancodeName(SDL_ScanCode scancode, const char *name)
154.56 +SDL_SetScancodeName(SDL_Scancode scancode, const char *name)
154.57 {
154.58 SDL_scancode_names[scancode] = name;
154.59 }
154.60 @@ -638,7 +638,7 @@
154.61 }
154.62
154.63 int
154.64 -SDL_SendKeyboardKey(Uint8 state, SDL_ScanCode scancode)
154.65 +SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
154.66 {
154.67 SDL_Keyboard *keyboard = &SDL_keyboard;
154.68 int posted;
154.69 @@ -832,7 +832,7 @@
154.70 return keyboard->keystate;
154.71 }
154.72
154.73 -SDLMod
154.74 +SDL_Keymod
154.75 SDL_GetModState(void)
154.76 {
154.77 SDL_Keyboard *keyboard = &SDL_keyboard;
154.78 @@ -841,26 +841,26 @@
154.79 }
154.80
154.81 void
154.82 -SDL_SetModState(SDLMod modstate)
154.83 +SDL_SetModState(SDL_Keymod modstate)
154.84 {
154.85 SDL_Keyboard *keyboard = &SDL_keyboard;
154.86
154.87 keyboard->modstate = modstate;
154.88 }
154.89
154.90 -SDLKey
154.91 -SDL_GetKeyFromScancode(SDL_ScanCode scancode)
154.92 +SDL_Keycode
154.93 +SDL_GetKeyFromScancode(SDL_Scancode scancode)
154.94 {
154.95 SDL_Keyboard *keyboard = &SDL_keyboard;
154.96
154.97 return keyboard->keymap[scancode];
154.98 }
154.99
154.100 -SDL_ScanCode
154.101 -SDL_GetScancodeFromKey(SDLKey key)
154.102 +SDL_Scancode
154.103 +SDL_GetScancodeFromKey(SDL_Keycode key)
154.104 {
154.105 SDL_Keyboard *keyboard = &SDL_keyboard;
154.106 - SDL_ScanCode scancode;
154.107 + SDL_Scancode scancode;
154.108
154.109 for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES;
154.110 ++scancode) {
154.111 @@ -872,7 +872,7 @@
154.112 }
154.113
154.114 const char *
154.115 -SDL_GetScancodeName(SDL_ScanCode scancode)
154.116 +SDL_GetScancodeName(SDL_Scancode scancode)
154.117 {
154.118 const char *name = SDL_scancode_names[scancode];
154.119
154.120 @@ -883,14 +883,14 @@
154.121 }
154.122
154.123 const char *
154.124 -SDL_GetKeyName(SDLKey key)
154.125 +SDL_GetKeyName(SDL_Keycode key)
154.126 {
154.127 static char name[8];
154.128 char *end;
154.129
154.130 if (key & SDLK_SCANCODE_MASK) {
154.131 return
154.132 - SDL_GetScancodeName((SDL_ScanCode) (key & ~SDLK_SCANCODE_MASK));
154.133 + SDL_GetScancodeName((SDL_Scancode) (key & ~SDLK_SCANCODE_MASK));
154.134 }
154.135
154.136 switch (key) {
155.1 --- a/src/events/SDL_keyboard_c.h Sun Feb 06 23:48:31 2011 -0800
155.2 +++ b/src/events/SDL_keyboard_c.h Sat Feb 12 19:16:09 2011 -0800
155.3 @@ -1,6 +1,6 @@
155.4 /*
155.5 SDL - Simple DirectMedia Layer
155.6 - Copyright (C) 1997-2010 Sam Lantinga
155.7 + Copyright (C) 1997-2011 Sam Lantinga
155.8
155.9 This library is free software; you can redistribute it and/or
155.10 modify it under the terms of the GNU Lesser General Public
155.11 @@ -34,22 +34,22 @@
155.12 extern void SDL_ResetKeyboard(void);
155.13
155.14 /* Get the default keymap */
155.15 -extern void SDL_GetDefaultKeymap(SDLKey * keymap);
155.16 +extern void SDL_GetDefaultKeymap(SDL_Keycode * keymap);
155.17
155.18 /* Set the mapping of scancode to key codes */
155.19 -extern void SDL_SetKeymap(int start, SDLKey * keys, int length);
155.20 +extern void SDL_SetKeymap(int start, SDL_Keycode * keys, int length);
155.21
155.22 /* Set a platform-dependent key name, overriding the default platform-agnostic
155.23 name. Encoded as UTF-8. The string is not copied, thus the pointer given to
155.24 this function must stay valid forever (or at least until the call to
155.25 VideoQuit()). */
155.26 -extern void SDL_SetScancodeName(SDL_ScanCode scancode, const char *name);
155.27 +extern void SDL_SetScancodeName(SDL_Scancode scancode, const char *name);
155.28
155.29 /* Set the keyboard focus window */
155.30 extern void SDL_SetKeyboardFocus(SDL_Window * window);
155.31
155.32 /* Send a keyboard key event */
155.33 -extern int SDL_SendKeyboardKey(Uint8 state, SDL_ScanCode scancode);
155.34 +extern int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode);
155.35
155.36 /* Send keyboard text input */
155.37 extern int SDL_SendKeyboardText(const char *text);
156.1 --- a/src/events/SDL_mouse.c Sun Feb 06 23:48:31 2011 -0800
156.2 +++ b/src/events/SDL_mouse.c Sat Feb 12 19:16:09 2011 -0800
156.3 @@ -1,6 +1,6 @@
156.4 /*
156.5 SDL - Simple DirectMedia Layer
156.6 - Copyright (C) 1997-2010 Sam Lantinga
156.7 + Copyright (C) 1997-2011 Sam Lantinga
156.8
156.9 This library is free software; you can redistribute it and/or
156.10 modify it under the terms of the GNU Lesser General Public
157.1 --- a/src/events/SDL_mouse_c.h Sun Feb 06 23:48:31 2011 -0800
157.2 +++ b/src/events/SDL_mouse_c.h Sat Feb 12 19:16:09 2011 -0800
157.3 @@ -1,6 +1,6 @@
157.4 /*
157.5 SDL - Simple DirectMedia Layer
157.6 - Copyright (C) 1997-2010 Sam Lantinga
157.7 + Copyright (C) 1997-2011 Sam Lantinga
157.8
157.9 This library is free software; you can redistribute it and/or
157.10 modify it under the terms of the GNU Lesser General Public
158.1 --- a/src/events/SDL_quit.c Sun Feb 06 23:48:31 2011 -0800
158.2 +++ b/src/events/SDL_quit.c Sat Feb 12 19:16:09 2011 -0800
158.3 @@ -1,6 +1,6 @@
158.4 /*
158.5 SDL - Simple DirectMedia Layer
158.6 - Copyright (C) 1997-2010 Sam Lantinga
158.7 + Copyright (C) 1997-2011 Sam Lantinga
158.8
158.9 This library is free software; you can redistribute it and/or
158.10 modify it under the terms of the GNU Lesser General Public
159.1 --- a/src/events/SDL_sysevents.h Sun Feb 06 23:48:31 2011 -0800
159.2 +++ b/src/events/SDL_sysevents.h Sat Feb 12 19:16:09 2011 -0800
159.3 @@ -1,6 +1,6 @@
159.4 /*
159.5 SDL - Simple DirectMedia Layer
159.6 - Copyright (C) 1997-2010 Sam Lantinga
159.7 + Copyright (C) 1997-2011 Sam Lantinga
159.8
159.9 This library is SDL_free software; you can redistribute it and/or
159.10 modify it under the terms of the GNU Lesser General Public
160.1 --- a/src/events/SDL_touch.c Sun Feb 06 23:48:31 2011 -0800
160.2 +++ b/src/events/SDL_touch.c Sat Feb 12 19:16:09 2011 -0800
160.3 @@ -1,6 +1,6 @@
160.4 /*
160.5 SDL - Simple DirectMedia Layer
160.6 - Copyright (C) 1997-2010 Sam Lantinga
160.7 + Copyright (C) 1997-2011 Sam Lantinga
160.8
160.9 This library is free software; you can redistribute it and/or
160.10 modify it under the terms of the GNU Lesser General Public
161.1 --- a/src/events/SDL_touch_c.h Sun Feb 06 23:48:31 2011 -0800
161.2 +++ b/src/events/SDL_touch_c.h Sat Feb 12 19:16:09 2011 -0800
161.3 @@ -1,6 +1,6 @@
161.4 /*
161.5 SDL - Simple DirectMedia Layer
161.6 - Copyright (C) 1997-2010 Sam Lantinga
161.7 + Copyright (C) 1997-2011 Sam Lantinga
161.8
161.9 This library is free software; you can redistribute it and/or
161.10 modify it under the terms of the GNU Lesser General Public
162.1 --- a/src/events/SDL_windowevents.c Sun Feb 06 23:48:31 2011 -0800
162.2 +++ b/src/events/SDL_windowevents.c Sat Feb 12 19:16:09 2011 -0800
162.3 @@ -1,6 +1,6 @@
162.4 /*
162.5 SDL - Simple DirectMedia Layer
162.6 - Copyright (C) 1997-2010 Sam Lantinga
162.7 + Copyright (C) 1997-2011 Sam Lantinga
162.8
162.9 This library is free software; you can redistribute it and/or
162.10 modify it under the terms of the GNU Lesser General Public
162.11 @@ -82,15 +82,10 @@
162.12 SDL_OnWindowHidden(window);
162.13 break;
162.14 case SDL_WINDOWEVENT_MOVED:
162.15 - if (window->flags & SDL_WINDOW_FULLSCREEN) {
162.16 + if (SDL_WINDOWPOS_ISUNDEFINED(data1) ||
162.17 + SDL_WINDOWPOS_ISUNDEFINED(data2)) {
162.18 return 0;
162.19 }
162.20 - if (data1 == SDL_WINDOWPOS_UNDEFINED) {
162.21 - data1 = window->x;
162.22 - }
162.23 - if (data2 == SDL_WINDOWPOS_UNDEFINED) {
162.24 - data2 = window->y;
162.25 - }
162.26 if (data1 == window->x && data2 == window->y) {
162.27 return 0;
162.28 }
162.29 @@ -98,9 +93,6 @@
162.30 window->y = data2;
162.31 break;
162.32 case SDL_WINDOWEVENT_RESIZED:
162.33 - if (window->flags & SDL_WINDOW_FULLSCREEN) {
162.34 - return 0;
162.35 - }
162.36 if (data1 == window->w && data2 == window->h) {
162.37 return 0;
162.38 }
163.1 --- a/src/events/SDL_windowevents_c.h Sun Feb 06 23:48:31 2011 -0800
163.2 +++ b/src/events/SDL_windowevents_c.h Sat Feb 12 19:16:09 2011 -0800
163.3 @@ -1,6 +1,6 @@
163.4 /*
163.5 SDL - Simple DirectMedia Layer
163.6 - Copyright (C) 1997-2010 Sam Lantinga
163.7 + Copyright (C) 1997-2011 Sam Lantinga
163.8
163.9 This library is free software; you can redistribute it and/or
163.10 modify it under the terms of the GNU Lesser General Public
164.1 --- a/src/events/blank_cursor.h Sun Feb 06 23:48:31 2011 -0800
164.2 +++ b/src/events/blank_cursor.h Sat Feb 12 19:16:09 2011 -0800
164.3 @@ -1,6 +1,6 @@
164.4 /*
164.5 SDL - Simple DirectMedia Layer
164.6 - Copyright (C) 1997-2010 Sam Lantinga
164.7 + Copyright (C) 1997-2011 Sam Lantinga
164.8
164.9 This library is free software; you can redistribute it and/or
164.10 modify it under the terms of the GNU Lesser General Public
165.1 --- a/src/events/default_cursor.h Sun Feb 06 23:48:31 2011 -0800
165.2 +++ b/src/events/default_cursor.h Sat Feb 12 19:16:09 2011 -0800
165.3 @@ -1,6 +1,6 @@
165.4 /*
165.5 SDL - Simple DirectMedia Layer
165.6 - Copyright (C) 1997-2010 Sam Lantinga
165.7 + Copyright (C) 1997-2011 Sam Lantinga
165.8
165.9 This library is free software; you can redistribute it and/or
165.10 modify it under the terms of the GNU Lesser General Public
166.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
166.2 +++ b/src/events/nds/SDL_ndsgesture.c Sat Feb 12 19:16:09 2011 -0800
166.3 @@ -0,0 +1,41 @@
166.4 +/*
166.5 + SDL - Simple DirectMedia Layer
166.6 + Copyright (C) 1997-2010 Sam Lantinga
166.7 +
166.8 + This library is free software; you can redistribute it and/or
166.9 + modify it under the terms of the GNU Lesser General Public
166.10 + License as published by the Free Software Foundation; either
166.11 + version 2.1 of the License, or (at your option) any later version.
166.12 +
166.13 + This library is distributed in the hope that it will be useful,
166.14 + but WITHOUT ANY WARRANTY; without even the implied warranty of
166.15 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
166.16 + Lesser General Public License for more details.
166.17 +
166.18 + You should have received a copy of the GNU Lesser General Public
166.19 + License along with this library; if not, write to the Free Software Founation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
166.20 +
166.21 + Sam Lantinga
166.22 + slouken@libsdl.org
166.23 +*/
166.24 +
166.25 +#include "SDL_config.h"
166.26 +
166.27 +/* No supported under the NDS because of math operations. */
166.28 +
166.29 +#include "SDL_events.h"
166.30 +#include "SDL_events_c.h"
166.31 +#include "SDL_gesture_c.h"
166.32 +
166.33 +int SDL_GestureAddTouch(SDL_Touch* touch)
166.34 +{
166.35 + return 0;
166.36 +}
166.37 +
166.38 +void SDL_GestureProcessEvent(SDL_Event* event)
166.39 +{
166.40 + return;
166.41 +}
166.42 +
166.43 +/* vi: set ts=4 sw=4 expandtab: */
166.44 +
167.1 --- a/src/events/scancodes_darwin.h Sun Feb 06 23:48:31 2011 -0800
167.2 +++ b/src/events/scancodes_darwin.h Sat Feb 12 19:16:09 2011 -0800
167.3 @@ -1,6 +1,6 @@
167.4 /*
167.5 SDL - Simple DirectMedia Layer
167.6 - Copyright (C) 1997-2010 Sam Lantinga
167.7 + Copyright (C) 1997-2011 Sam Lantinga
167.8
167.9 This library is free software; you can redistribute it and/or
167.10 modify it under the terms of the GNU Lesser General Public
167.11 @@ -27,7 +27,7 @@
167.12 - experimentation on various ADB and USB ISO keyboards and one ADB ANSI keyboard
167.13 */
167.14 /* *INDENT-OFF* */
167.15 -static const SDL_ScanCode darwin_scancode_table[] = {
167.16 +static const SDL_Scancode darwin_scancode_table[] = {
167.17 /* 0 */ SDL_SCANCODE_A,
167.18 /* 1 */ SDL_SCANCODE_S,
167.19 /* 2 */ SDL_SCANCODE_D,
168.1 --- a/src/events/scancodes_linux.h Sun Feb 06 23:48:31 2011 -0800
168.2 +++ b/src/events/scancodes_linux.h Sat Feb 12 19:16:09 2011 -0800
168.3 @@ -1,6 +1,6 @@
168.4 /*
168.5 SDL - Simple DirectMedia Layer
168.6 - Copyright (C) 1997-2010 Sam Lantinga
168.7 + Copyright (C) 1997-2011 Sam Lantinga
168.8
168.9 This library is free software; you can redistribute it and/or
168.10 modify it under the terms of the GNU Lesser General Public
168.11 @@ -21,12 +21,12 @@
168.12 */
168.13 #include "../../include/SDL_scancode.h"
168.14
168.15 -/* Linux virtual key code to SDLKey mapping table
168.16 +/* Linux virtual key code to SDL_Keycode mapping table
168.17 Sources:
168.18 - Linux kernel source input.h
168.19 */
168.20 /* *INDENT-OFF* */
168.21 -static SDL_ScanCode const linux_scancode_table[] = {
168.22 +static SDL_Scancode const linux_scancode_table[] = {
168.23 /* 0 */ SDL_SCANCODE_UNKNOWN,
168.24 /* 1 */ SDL_SCANCODE_ESCAPE,
168.25 /* 2 */ SDL_SCANCODE_1,
169.1 --- a/src/events/scancodes_windows.h Sun Feb 06 23:48:31 2011 -0800
169.2 +++ b/src/events/scancodes_windows.h Sat Feb 12 19:16:09 2011 -0800
169.3 @@ -1,6 +1,6 @@
169.4 /*
169.5 SDL - Simple DirectMedia Layer
169.6 - Copyright (C) 1997-2010 Sam Lantinga
169.7 + Copyright (C) 1997-2011 Sam Lantinga
169.8
169.9 This library is free software; you can redistribute it and/or
169.10 modify it under the terms of the GNU Lesser General Public
169.11 @@ -26,7 +26,7 @@
169.12 - msdn.microsoft.com
169.13 */
169.14 /* *INDENT-OFF* */
169.15 -static const SDL_ScanCode windows_scancode_table[] = {
169.16 +static const SDL_Scancode windows_scancode_table[] = {
169.17 /* 0, 0x00 */ SDL_SCANCODE_UNKNOWN,
169.18 /* 1, 0x01 */ SDL_SCANCODE_UNKNOWN,
169.19 /* 2, 0x02 */ SDL_SCANCODE_UNKNOWN,
170.1 --- a/src/events/scancodes_xfree86.h Sun Feb 06 23:48:31 2011 -0800
170.2 +++ b/src/events/scancodes_xfree86.h Sat Feb 12 19:16:09 2011 -0800
170.3 @@ -1,6 +1,6 @@
170.4 /*
170.5 SDL - Simple DirectMedia Layer
170.6 - Copyright (C) 1997-2010 Sam Lantinga
170.7 + Copyright (C) 1997-2011 Sam Lantinga
170.8
170.9 This library is free software; you can redistribute it and/or
170.10 modify it under the terms of the GNU Lesser General Public
170.11 @@ -26,7 +26,7 @@
170.12 - atKeyNames.h from XFree86 source code
170.13 */
170.14 /* *INDENT-OFF* */
170.15 -static const SDL_ScanCode xfree86_scancode_table[] = {
170.16 +static const SDL_Scancode xfree86_scancode_table[] = {
170.17 /* 0 */ SDL_SCANCODE_UNKNOWN,
170.18 /* 1 */ SDL_SCANCODE_ESCAPE,
170.19 /* 2 */ SDL_SCANCODE_1,
170.20 @@ -177,7 +177,7 @@
170.21 };
170.22
170.23 /* for wireless usb keyboard (manufacturer TRUST) without numpad. */
170.24 -static const SDL_ScanCode xfree86_scancode_table2[] = {
170.25 +static const SDL_Scancode xfree86_scancode_table2[] = {
170.26 /* 0 */ SDL_SCANCODE_UNKNOWN,
170.27 /* 1 */ SDL_SCANCODE_ESCAPE,
170.28 /* 2 */ SDL_SCANCODE_1,
171.1 --- a/src/file/SDL_rwops.c Sun Feb 06 23:48:31 2011 -0800
171.2 +++ b/src/file/SDL_rwops.c Sat Feb 12 19:16:09 2011 -0800
171.3 @@ -1,6 +1,6 @@
171.4 /*
171.5 SDL - Simple DirectMedia Layer
171.6 - Copyright (C) 1997-2010 Sam Lantinga
171.7 + Copyright (C) 1997-2011 Sam Lantinga
171.8
171.9 This library is free software; you can redistribute it and/or
171.10 modify it under the terms of the GNU Lesser General Public
172.1 --- a/src/haptic/SDL_haptic_c.h Sun Feb 06 23:48:31 2011 -0800
172.2 +++ b/src/haptic/SDL_haptic_c.h Sat Feb 12 19:16:09 2011 -0800
172.3 @@ -1,6 +1,6 @@
172.4 /*
172.5 SDL - Simple DirectMedia Layer
172.6 - Copyright (C) 1997-2010 Sam Lantinga
172.7 + Copyright (C) 1997-2011 Sam Lantinga
172.8
172.9 This library is free software; you can redistribute it and/or
172.10 modify it under the terms of the GNU Lesser General Public
173.1 --- a/src/haptic/nds/SDL_syshaptic.c Sun Feb 06 23:48:31 2011 -0800
173.2 +++ b/src/haptic/nds/SDL_syshaptic.c Sat Feb 12 19:16:09 2011 -0800
173.3 @@ -26,21 +26,21 @@
173.4 #include "SDL_haptic.h"
173.5 #include "../SDL_syshaptic.h"
173.6 #include "SDL_joystick.h"
173.7 +#include <nds/memory.h>
173.8 #include <nds/arm9/rumble.h>
173.9 -#include <nds/memory.h>
173.10
173.11 #define MAX_HAPTICS 1
173.12 /* right now only the ezf3in1 (and maybe official rumble pak) are supported
173.13 and there can only be one of those in at a time (in GBA slot.) */
173.14
173.15 -SDL_Haptic *nds_haptic = NULL;
173.16 +static SDL_Haptic *nds_haptic = NULL;
173.17
173.18 -typedef struct
173.19 +struct haptic_hwdata
173.20 {
173.21 enum
173.22 { NONE, OFFICIAL, EZF3IN1 } type;
173.23 int pos;
173.24 -} NDS_HapticData;
173.25 +};
173.26
173.27
173.28 void
173.29 @@ -165,7 +165,7 @@
173.30 return -1;
173.31 }
173.32
173.33 - haptic->hwdata = SDL_malloc(sizeof(NDS_HapticData));
173.34 + haptic->hwdata = SDL_malloc(sizeof(struct haptic_hwdata));
173.35 if (!haptic->hwdata) {
173.36 SDL_OutOfMemory();
173.37 return -1;
174.1 --- a/src/joystick/SDL_joystick.c Sun Feb 06 23:48:31 2011 -0800
174.2 +++ b/src/joystick/SDL_joystick.c Sat Feb 12 19:16:09 2011 -0800
174.3 @@ -1,6 +1,6 @@
174.4 /*
174.5 SDL - Simple DirectMedia Layer
174.6 - Copyright (C) 1997-2010 Sam Lantinga
174.7 + Copyright (C) 1997-2011 Sam Lantinga
174.8
174.9 This library is free software; you can redistribute it and/or
174.10 modify it under the terms of the GNU Lesser General Public
175.1 --- a/src/joystick/SDL_joystick_c.h Sun Feb 06 23:48:31 2011 -0800
175.2 +++ b/src/joystick/SDL_joystick_c.h Sat Feb 12 19:16:09 2011 -0800
175.3 @@ -1,6 +1,6 @@
175.4 /*
175.5 SDL - Simple DirectMedia Layer
175.6 - Copyright (C) 1997-2010 Sam Lantinga
175.7 + Copyright (C) 1997-2011 Sam Lantinga
175.8
175.9 This library is free software; you can redistribute it and/or
175.10 modify it under the terms of the GNU Lesser General Public
176.1 --- a/src/joystick/SDL_sysjoystick.h Sun Feb 06 23:48:31 2011 -0800
176.2 +++ b/src/joystick/SDL_sysjoystick.h Sat Feb 12 19:16:09 2011 -0800
176.3 @@ -1,6 +1,6 @@
176.4 /*
176.5 SDL - Simple DirectMedia Layer
176.6 - Copyright (C) 1997-2010 Sam Lantinga
176.7 + Copyright (C) 1997-2011 Sam Lantinga
176.8
176.9 This library is SDL_free software; you can redistribute it and/or
176.10 modify it under the terms of the GNU Lesser General Public
177.1 --- a/src/joystick/android/SDL_sysjoystick.c Sun Feb 06 23:48:31 2011 -0800
177.2 +++ b/src/joystick/android/SDL_sysjoystick.c Sat Feb 12 19:16:09 2011 -0800
177.3 @@ -1,6 +1,6 @@
177.4 /*
177.5 SDL - Simple DirectMedia Layer
177.6 - Copyright (C) 1997-2010 Sam Lantinga
177.7 + Copyright (C) 1997-2011 Sam Lantinga
177.8
177.9 This library is free software; you can redistribute it and/or
177.10 modify it under the terms of the GNU Lesser General Public
178.1 --- a/src/joystick/beos/SDL_bejoystick.cc Sun Feb 06 23:48:31 2011 -0800
178.2 +++ b/src/joystick/beos/SDL_bejoystick.cc Sat Feb 12 19:16:09 2011 -0800
178.3 @@ -1,6 +1,6 @@
178.4 /*
178.5 SDL - Simple DirectMedia Layer
178.6 - Copyright (C) 1997-2009 Sam Lantinga
178.7 + Copyright (C) 1997-2011 Sam Lantinga
178.8
178.9 This library is free software; you can redistribute it and/or
178.10 modify it under the terms of the GNU Lesser General Public
179.1 --- a/src/joystick/bsd/SDL_sysjoystick.c Sun Feb 06 23:48:31 2011 -0800
179.2 +++ b/src/joystick/bsd/SDL_sysjoystick.c Sat Feb 12 19:16:09 2011 -0800
179.3 @@ -1,6 +1,6 @@
179.4 /*
179.5 SDL - Simple DirectMedia Layer
179.6 - Copyright (C) 1997-2010 Sam Lantinga
179.7 + Copyright (C) 1997-2011 Sam Lantinga
179.8
179.9 This library is free software; you can redistribute it and/or
179.10 modify it under the terms of the GNU Lesser General Public
180.1 --- a/src/joystick/darwin/SDL_sysjoystick.c Sun Feb 06 23:48:31 2011 -0800
180.2 +++ b/src/joystick/darwin/SDL_sysjoystick.c Sat Feb 12 19:16:09 2011 -0800
180.3 @@ -1,6 +1,6 @@
180.4 /*
180.5 SDL - Simple DirectMedia Layer
180.6 - Copyright (C) 1997-2010 Sam Lantinga
180.7 + Copyright (C) 1997-2011 Sam Lantinga
180.8
180.9 This library is free software; you can redistribute it and/or
180.10 modify it under the terms of the GNU Lesser General Public
181.1 --- a/src/joystick/darwin/SDL_sysjoystick_c.h Sun Feb 06 23:48:31 2011 -0800
181.2 +++ b/src/joystick/darwin/SDL_sysjoystick_c.h Sat Feb 12 19:16:09 2011 -0800
181.3 @@ -1,6 +1,6 @@
181.4 /*
181.5 SDL - Simple DirectMedia Layer
181.6 - Copyright (C) 1997-2010 Sam Lantinga
181.7 + Copyright (C) 1997-2011 Sam Lantinga
181.8
181.9 This library is free software; you can redistribute it and/or
181.10 modify it under the terms of the GNU Lesser General Public
182.1 --- a/src/joystick/dummy/SDL_sysjoystick.c Sun Feb 06 23:48:31 2011 -0800
182.2 +++ b/src/joystick/dummy/SDL_sysjoystick.c Sat Feb 12 19:16:09 2011 -0800
182.3 @@ -1,6 +1,6 @@
182.4 /*
182.5 SDL - Simple DirectMedia Layer
182.6 - Copyright (C) 1997-2010 Sam Lantinga
182.7 + Copyright (C) 1997-2011 Sam Lantinga
182.8
182.9 This library is free software; you can redistribute it and/or
182.10 modify it under the terms of the GNU Lesser General Public
183.1 --- a/src/joystick/iphoneos/SDLUIAccelerationDelegate.h Sun Feb 06 23:48:31 2011 -0800
183.2 +++ b/src/joystick/iphoneos/SDLUIAccelerationDelegate.h Sat Feb 12 19:16:09 2011 -0800
183.3 @@ -1,6 +1,6 @@
183.4 /*
183.5 SDL - Simple DirectMedia Layer
183.6 - Copyright (C) 1997-2010 Sam Lantinga
183.7 + Copyright (C) 1997-2011 Sam Lantinga
183.8
183.9 This library is free software; you can redistribute it and/or
183.10 modify it under the terms of the GNU Lesser General Public
184.1 --- a/src/joystick/iphoneos/SDLUIAccelerationDelegate.m Sun Feb 06 23:48:31 2011 -0800
184.2 +++ b/src/joystick/iphoneos/SDLUIAccelerationDelegate.m Sat Feb 12 19:16:09 2011 -0800
184.3 @@ -1,24 +1,24 @@
184.4 /*
184.5 - SDL - Simple DirectMedia Layer
184.6 - Copyright (C) 1997-2009 Sam Lantinga
184.7 -
184.8 - This library is free software; you can redistribute it and/or
184.9 - modify it under the terms of the GNU Lesser General Public
184.10 - License as published by the Free Software Foundation; either
184.11 - version 2.1 of the License, or (at your option) any later version.
184.12 -
184.13 - This library is distributed in the hope that it will be useful,
184.14 - but WITHOUT ANY WARRANTY; without even the implied warranty of
184.15 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
184.16 - Lesser General Public License for more details.
184.17 -
184.18 - You should have received a copy of the GNU Lesser General Public
184.19 - License along with this library; if not, write to the Free Software
184.20 - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
184.21 -
184.22 - Sam Lantinga
184.23 - slouken@libsdl.org
184.24 - */
184.25 + SDL - Simple DirectMedia Layer
184.26 + Copyright (C) 1997-2011 Sam Lantinga
184.27 +
184.28 + This library is free software; you can redistribute it and/or
184.29 + modify it under the terms of the GNU Lesser General Public
184.30 + License as published by the Free Software Foundation; either
184.31 + version 2.1 of the License, or (at your option) any later version.
184.32 +
184.33 + This library is distributed in the hope that it will be useful,
184.34 + but WITHOUT ANY WARRANTY; without even the implied warranty of
184.35 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
184.36 + Lesser General Public License for more details.
184.37 +
184.38 + You should have received a copy of the GNU Lesser General Public
184.39 + License along with this library; if not, write to the Free Software
184.40 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
184.41 +
184.42 + Sam Lantinga
184.43 + slouken@libsdl.org
184.44 +*/
184.45
184.46 #import "SDLUIAccelerationDelegate.h"
184.47 /* needed for SDL_IPHONE_MAX_GFORCE macro */
185.1 --- a/src/joystick/iphoneos/SDL_sysjoystick.m Sun Feb 06 23:48:31 2011 -0800
185.2 +++ b/src/joystick/iphoneos/SDL_sysjoystick.m Sat Feb 12 19:16:09 2011 -0800
185.3 @@ -1,6 +1,6 @@
185.4 /*
185.5 SDL - Simple DirectMedia Layer
185.6 - Copyright (C) 1997-2009 Sam Lantinga
185.7 + Copyright (C) 1997-2011 Sam Lantinga
185.8
185.9 This library is free software; you can redistribute it and/or
185.10 modify it under the terms of the GNU Lesser General Public
186.1 --- a/src/joystick/linux/SDL_sysjoystick.c Sun Feb 06 23:48:31 2011 -0800
186.2 +++ b/src/joystick/linux/SDL_sysjoystick.c Sat Feb 12 19:16:09 2011 -0800
186.3 @@ -1,6 +1,6 @@
186.4 /*
186.5 SDL - Simple DirectMedia Layer
186.6 - Copyright (C) 1997-2010 Sam Lantinga
186.7 + Copyright (C) 1997-2011 Sam Lantinga
186.8
186.9 This library is free software; you can redistribute it and/or
186.10 modify it under the terms of the GNU Lesser General Public
187.1 --- a/src/joystick/linux/SDL_sysjoystick_c.h Sun Feb 06 23:48:31 2011 -0800
187.2 +++ b/src/joystick/linux/SDL_sysjoystick_c.h Sat Feb 12 19:16:09 2011 -0800
187.3 @@ -1,6 +1,6 @@
187.4 /*
187.5 SDL - Simple DirectMedia Layer
187.6 - Copyright (C) 1997-2010 Sam Lantinga
187.7 + Copyright (C) 1997-2011 Sam Lantinga
187.8
187.9 This library is free software; you can redistribute it and/or
187.10 modify it under the terms of the GNU Lesser General Public
188.1 --- a/src/joystick/nds/SDL_sysjoystick.c Sun Feb 06 23:48:31 2011 -0800
188.2 +++ b/src/joystick/nds/SDL_sysjoystick.c Sat Feb 12 19:16:09 2011 -0800
188.3 @@ -1,6 +1,6 @@
188.4 /*
188.5 SDL - Simple DirectMedia Layer
188.6 - Copyright (C) 1997-2010 Sam Lantinga
188.7 + Copyright (C) 1997-2011 Sam Lantinga
188.8
188.9 This library is free software; you can redistribute it and/or
188.10 modify it under the terms of the GNU Lesser General Public
189.1 --- a/src/joystick/windows/SDL_dxjoystick.c Sun Feb 06 23:48:31 2011 -0800
189.2 +++ b/src/joystick/windows/SDL_dxjoystick.c Sat Feb 12 19:16:09 2011 -0800
189.3 @@ -1,6 +1,6 @@
189.4 /*
189.5 SDL - Simple DirectMedia Layer
189.6 - Copyright (C) 1997-2010 Sam Lantinga
189.7 + Copyright (C) 1997-2011 Sam Lantinga
189.8
189.9 This library is free software; you can redistribute it and/or
189.10 modify it under the terms of the GNU Lesser General Public
190.1 --- a/src/joystick/windows/SDL_dxjoystick_c.h Sun Feb 06 23:48:31 2011 -0800
190.2 +++ b/src/joystick/windows/SDL_dxjoystick_c.h Sat Feb 12 19:16:09 2011 -0800
190.3 @@ -1,6 +1,6 @@
190.4 /*
190.5 SDL - Simple DirectMedia Layer
190.6 - Copyright (C) 1997-2010 Sam Lantinga
190.7 + Copyright (C) 1997-2011 Sam Lantinga
190.8
190.9 This library is free software; you can redistribute it and/or
190.10 modify it under the terms of the GNU Lesser General Public
191.1 --- a/src/joystick/windows/SDL_mmjoystick.c Sun Feb 06 23:48:31 2011 -0800
191.2 +++ b/src/joystick/windows/SDL_mmjoystick.c Sat Feb 12 19:16:09 2011 -0800
191.3 @@ -1,6 +1,6 @@
191.4 /*
191.5 SDL - Simple DirectMedia Layer
191.6 - Copyright (C) 1997-2010 Sam Lantinga
191.7 + Copyright (C) 1997-2011 Sam Lantinga
191.8
191.9 This library is free software; you can redistribute it and/or
191.10 modify it under the terms of the GNU Lesser General Public
192.1 --- a/src/libm/math.h Sun Feb 06 23:48:31 2011 -0800
192.2 +++ b/src/libm/math.h Sat Feb 12 19:16:09 2011 -0800
192.3 @@ -1,6 +1,6 @@
192.4 /*
192.5 SDL - Simple DirectMedia Layer
192.6 - Copyright (C) 1997-2010 Sam Lantinga
192.7 + Copyright (C) 1997-2011 Sam Lantinga
192.8
192.9 This library is free software; you can redistribute it and/or
192.10 modify it under the terms of the GNU Lesser General Public
193.1 --- a/src/loadso/beos/SDL_sysloadso.c Sun Feb 06 23:48:31 2011 -0800
193.2 +++ b/src/loadso/beos/SDL_sysloadso.c Sat Feb 12 19:16:09 2011 -0800
193.3 @@ -1,6 +1,6 @@
193.4 /*
193.5 SDL - Simple DirectMedia Layer
193.6 - Copyright (C) 1997-2010 Sam Lantinga
193.7 + Copyright (C) 1997-2011 Sam Lantinga
193.8
193.9 This library is free software; you can redistribute it and/or
193.10 modify it under the terms of the GNU Lesser General Public
194.1 --- a/src/loadso/dlopen/SDL_sysloadso.c Sun Feb 06 23:48:31 2011 -0800
194.2 +++ b/src/loadso/dlopen/SDL_sysloadso.c Sat Feb 12 19:16:09 2011 -0800
194.3 @@ -1,6 +1,6 @@
194.4 /*
194.5 SDL - Simple DirectMedia Layer
194.6 - Copyright (C) 1997-2010 Sam Lantinga
194.7 + Copyright (C) 1997-2011 Sam Lantinga
194.8
194.9 This library is free software; you can redistribute it and/or
194.10 modify it under the terms of the GNU Lesser General Public
195.1 --- a/src/loadso/dummy/SDL_sysloadso.c Sun Feb 06 23:48:31 2011 -0800
195.2 +++ b/src/loadso/dummy/SDL_sysloadso.c Sat Feb 12 19:16:09 2011 -0800
195.3 @@ -1,6 +1,6 @@
195.4 /*
195.5 SDL - Simple DirectMedia Layer
195.6 - Copyright (C) 1997-2010 Sam Lantinga
195.7 + Copyright (C) 1997-2011 Sam Lantinga
195.8
195.9 This library is free software; you can redistribute it and/or
195.10 modify it under the terms of the GNU Lesser General Public
196.1 --- a/src/loadso/macosx/SDL_dlcompat.c Sun Feb 06 23:48:31 2011 -0800
196.2 +++ b/src/loadso/macosx/SDL_dlcompat.c Sat Feb 12 19:16:09 2011 -0800
196.3 @@ -1,6 +1,6 @@
196.4 /*
196.5 SDL - Simple DirectMedia Layer
196.6 - Copyright (C) 1997-2010 Sam Lantinga
196.7 + Copyright (C) 1997-2011 Sam Lantinga
196.8
196.9 This library is free software; you can redistribute it and/or
196.10 modify it under the terms of the GNU Lesser General Public
197.1 --- a/src/loadso/windows/SDL_sysloadso.c Sun Feb 06 23:48:31 2011 -0800
197.2 +++ b/src/loadso/windows/SDL_sysloadso.c Sat Feb 12 19:16:09 2011 -0800
197.3 @@ -1,6 +1,6 @@
197.4 /*
197.5 SDL - Simple DirectMedia Layer
197.6 - Copyright (C) 1997-2010 Sam Lantinga
197.7 + Copyright (C) 1997-2011 Sam Lantinga
197.8
197.9 This library is free software; you can redistribute it and/or
197.10 modify it under the terms of the GNU Lesser General Public
198.1 --- a/src/main/beos/SDL_BeApp.cc Sun Feb 06 23:48:31 2011 -0800
198.2 +++ b/src/main/beos/SDL_BeApp.cc Sat Feb 12 19:16:09 2011 -0800
198.3 @@ -1,6 +1,6 @@
198.4 /*
198.5 SDL - Simple DirectMedia Layer
198.6 - Copyright (C) 1997-2009 Sam Lantinga
198.7 + Copyright (C) 1997-2011 Sam Lantinga
198.8
198.9 This library is free software; you can redistribute it and/or
198.10 modify it under the terms of the GNU Lesser General Public
199.1 --- a/src/main/beos/SDL_BeApp.h Sun Feb 06 23:48:31 2011 -0800
199.2 +++ b/src/main/beos/SDL_BeApp.h Sat Feb 12 19:16:09 2011 -0800
199.3 @@ -1,6 +1,6 @@
199.4 /*
199.5 SDL - Simple DirectMedia Layer
199.6 - Copyright (C) 1997-2010 Sam Lantinga
199.7 + Copyright (C) 1997-2011 Sam Lantinga
199.8
199.9 This library is free software; you can redistribute it and/or
199.10 modify it under the terms of the GNU Lesser General Public
200.1 --- a/src/power/SDL_power.c Sun Feb 06 23:48:31 2011 -0800
200.2 +++ b/src/power/SDL_power.c Sat Feb 12 19:16:09 2011 -0800
200.3 @@ -1,6 +1,6 @@
200.4 /*
200.5 SDL - Simple DirectMedia Layer
200.6 - Copyright (C) 1997-2010 Sam Lantinga
200.7 + Copyright (C) 1997-2011 Sam Lantinga
200.8
200.9 This library is free software; you can redistribute it and/or
200.10 modify it under the terms of the GNU Lesser General Public
201.1 --- a/src/power/beos/SDL_syspower.c Sun Feb 06 23:48:31 2011 -0800
201.2 +++ b/src/power/beos/SDL_syspower.c Sat Feb 12 19:16:09 2011 -0800
201.3 @@ -1,6 +1,6 @@
201.4 /*
201.5 SDL - Simple DirectMedia Layer
201.6 - Copyright (C) 1997-2010 Sam Lantinga
201.7 + Copyright (C) 1997-2011 Sam Lantinga
201.8
201.9 This library is free software; you can redistribute it and/or
201.10 modify it under the terms of the GNU Lesser General Public
202.1 --- a/src/power/linux/SDL_syspower.c Sun Feb 06 23:48:31 2011 -0800
202.2 +++ b/src/power/linux/SDL_syspower.c Sat Feb 12 19:16:09 2011 -0800
202.3 @@ -1,6 +1,6 @@
202.4 /*
202.5 SDL - Simple DirectMedia Layer
202.6 - Copyright (C) 1997-2010 Sam Lantinga
202.7 + Copyright (C) 1997-2011 Sam Lantinga
202.8
202.9 This library is free software; you can redistribute it and/or
202.10 modify it under the terms of the GNU Lesser General Public
203.1 --- a/src/power/macosx/SDL_syspower.c Sun Feb 06 23:48:31 2011 -0800
203.2 +++ b/src/power/macosx/SDL_syspower.c Sat Feb 12 19:16:09 2011 -0800
203.3 @@ -1,6 +1,6 @@
203.4 /*
203.5 SDL - Simple DirectMedia Layer
203.6 - Copyright (C) 1997-2010 Sam Lantinga
203.7 + Copyright (C) 1997-2011 Sam Lantinga
203.8
203.9 This library is free software; you can redistribute it and/or
203.10 modify it under the terms of the GNU Lesser General Public
204.1 --- a/src/power/nds/SDL_syspower.c Sun Feb 06 23:48:31 2011 -0800
204.2 +++ b/src/power/nds/SDL_syspower.c Sat Feb 12 19:16:09 2011 -0800
204.3 @@ -1,6 +1,6 @@
204.4 /*
204.5 SDL - Simple DirectMedia Layer
204.6 - Copyright (C) 1997-2010 Sam Lantinga
204.7 + Copyright (C) 1997-2011 Sam Lantinga
204.8
204.9 This library is free software; you can redistribute it and/or
204.10 modify it under the terms of the GNU Lesser General Public
205.1 --- a/src/power/uikit/SDL_syspower.m Sun Feb 06 23:48:31 2011 -0800
205.2 +++ b/src/power/uikit/SDL_syspower.m Sat Feb 12 19:16:09 2011 -0800
205.3 @@ -1,6 +1,6 @@
205.4 /*
205.5 SDL - Simple DirectMedia Layer
205.6 - Copyright (C) 1997-2010 Sam Lantinga
205.7 + Copyright (C) 1997-2011 Sam Lantinga
205.8
205.9 This library is free software; you can redistribute it and/or
205.10 modify it under the terms of the GNU Lesser General Public
206.1 --- a/src/power/windows/SDL_syspower.c Sun Feb 06 23:48:31 2011 -0800
206.2 +++ b/src/power/windows/SDL_syspower.c Sat Feb 12 19:16:09 2011 -0800
206.3 @@ -1,6 +1,6 @@
206.4 /*
206.5 SDL - Simple DirectMedia Layer
206.6 - Copyright (C) 1997-2010 Sam Lantinga
206.7 + Copyright (C) 1997-2011 Sam Lantinga
206.8
206.9 This library is free software; you can redistribute it and/or
206.10 modify it under the terms of the GNU Lesser General Public
207.1 --- a/src/render/SDL_render.c Sun Feb 06 23:48:31 2011 -0800
207.2 +++ b/src/render/SDL_render.c Sat Feb 12 19:16:09 2011 -0800
207.3 @@ -1,6 +1,6 @@
207.4 /*
207.5 SDL - Simple DirectMedia Layer
207.6 - Copyright (C) 1997-2010 Sam Lantinga
207.7 + Copyright (C) 1997-2011 Sam Lantinga
207.8
207.9 This library is free software; you can redistribute it and/or
207.10 modify it under the terms of the GNU Lesser General Public
207.11 @@ -24,6 +24,7 @@
207.12 /* The SDL 2D rendering system */
207.13
207.14 #include "SDL_hints.h"
207.15 +#include "SDL_log.h"
207.16 #include "SDL_render.h"
207.17 #include "SDL_sysrender.h"
207.18 #include "../video/SDL_pixels_c.h"
207.19 @@ -44,6 +45,7 @@
207.20
207.21
207.22 static const SDL_RenderDriver *render_drivers[] = {
207.23 +#if !SDL_RENDER_DISABLED
207.24 #if SDL_VIDEO_RENDER_D3D
207.25 &D3D_RenderDriver,
207.26 #endif
207.27 @@ -59,7 +61,11 @@
207.28 #if SDL_VIDEO_RENDER_DIRECTFB
207.29 &DirectFB_RenderDriver,
207.30 #endif
207.31 +#if SDL_VIDEO_RENDER_NDS
207.32 + &NDS_RenderDriver,
207.33 +#endif
207.34 &SW_RenderDriver
207.35 +#endif /* !SDL_RENDER_DISABLED */
207.36 };
207.37 static char renderer_magic;
207.38 static char texture_magic;
207.39 @@ -159,6 +165,9 @@
207.40 renderer->window = window;
207.41
207.42 SDL_AddEventWatch(SDL_RendererEventWatch, renderer);
207.43 +
207.44 + SDL_LogInfo(SDL_LOG_CATEGORY_RENDER,
207.45 + "Created renderer: %s", renderer->info.name);
207.46 }
207.47 return renderer;
207.48 }
207.49 @@ -166,7 +175,12 @@
207.50 SDL_Renderer *
207.51 SDL_CreateSoftwareRenderer(SDL_Surface * surface)
207.52 {
207.53 +#if !SDL_RENDER_DISABLED
207.54 return SW_CreateRendererForSurface(surface);
207.55 +#else
207.56 + SDL_SetError("SDL not built with rendering support");
207.57 + return NULL;
207.58 +#endif /* !SDL_RENDER_DISABLED */
207.59 }
207.60
207.61 int
207.62 @@ -195,12 +209,22 @@
207.63 GetClosestSupportedFormat(SDL_Renderer * renderer, Uint32 format)
207.64 {
207.65 Uint32 i;
207.66 - SDL_bool hasAlpha = SDL_ISPIXELFORMAT_ALPHA(format);
207.67
207.68 - /* We just want to match the first format that has the same channels */
207.69 - for (i = 0; i < renderer->info.num_texture_formats; ++i) {
207.70 - if (SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == hasAlpha) {
207.71 - return renderer->info.texture_formats[i];
207.72 + if (SDL_ISPIXELFORMAT_FOURCC(format)) {
207.73 + /* Look for an exact match */
207.74 + for (i = 0; i < renderer->info.num_texture_formats; ++i) {
207.75 + if (renderer->info.texture_formats[i] == format) {
207.76 + return renderer->info.texture_formats[i];
207.77 + }
207.78 + }
207.79 + } else {
207.80 + SDL_bool hasAlpha = SDL_ISPIXELFORMAT_ALPHA(format);
207.81 +
207.82 + /* We just want to match the first format that has the same channels */
207.83 + for (i = 0; i < renderer->info.num_texture_formats; ++i) {
207.84 + if (SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == hasAlpha) {
207.85 + return renderer->info.texture_formats[i];
207.86 + }
207.87 }
207.88 }
207.89 return renderer->info.texture_formats[0];
207.90 @@ -302,7 +326,8 @@
207.91 }
207.92 format = renderer->info.texture_formats[0];
207.93 for (i = 0; i < renderer->info.num_texture_formats; ++i) {
207.94 - if (SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == needAlpha) {
207.95 + if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) &&
207.96 + SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == needAlpha) {
207.97 format = renderer->info.texture_formats[i];
207.98 break;
207.99 }
207.100 @@ -721,6 +746,14 @@
207.101 }
207.102 }
207.103
207.104 +void
207.105 +SDL_RenderSetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
207.106 +{
207.107 + CHECK_RENDERER_MAGIC(renderer, );
207.108 +
207.109 + renderer->SetClipRect(renderer, rect);
207.110 +}
207.111 +
207.112 int
207.113 SDL_SetRenderDrawColor(SDL_Renderer * renderer,
207.114 Uint8 r, Uint8 g, Uint8 b, Uint8 a)
208.1 --- a/src/render/SDL_sysrender.h Sun Feb 06 23:48:31 2011 -0800
208.2 +++ b/src/render/SDL_sysrender.h Sat Feb 12 19:16:09 2011 -0800
208.3 @@ -1,6 +1,6 @@
208.4 /*
208.5 SDL - Simple DirectMedia Layer
208.6 - Copyright (C) 1997-2010 Sam Lantinga
208.7 + Copyright (C) 1997-2011 Sam Lantinga
208.8
208.9 This library is free software; you can redistribute it and/or
208.10 modify it under the terms of the GNU Lesser General Public
208.11 @@ -78,6 +78,7 @@
208.12 int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
208.13 const SDL_Rect * rect, void **pixels, int *pitch);
208.14 void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
208.15 + void (*SetClipRect) (SDL_Renderer * renderer, const SDL_Rect *rect);
208.16 int (*RenderClear) (SDL_Renderer * renderer);
208.17 int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_Point * points,
208.18 int count);
208.19 @@ -118,6 +119,8 @@
208.20 SDL_RendererInfo info;
208.21 };
208.22
208.23 +#if !SDL_RENDER_DISABLED
208.24 +
208.25 #if SDL_VIDEO_RENDER_D3D
208.26 extern SDL_RenderDriver D3D_RenderDriver;
208.27 #endif
208.28 @@ -133,8 +136,13 @@
208.29 #if SDL_VIDEO_RENDER_DIRECTFB
208.30 extern SDL_RenderDriver DirectFB_RenderDriver;
208.31 #endif
208.32 +#ifdef SDL_VIDEO_RENDER_NDS
208.33 +extern SDL_RenderDriver NDS_RenderDriver;
208.34 +#endif
208.35 extern SDL_RenderDriver SW_RenderDriver;
208.36
208.37 +#endif /* !SDL_RENDER_DISABLED */
208.38 +
208.39 #endif /* _SDL_sysrender_h */
208.40
208.41 /* vi: set ts=4 sw=4 expandtab: */
209.1 --- a/src/render/SDL_yuv_mmx.c Sun Feb 06 23:48:31 2011 -0800
209.2 +++ b/src/render/SDL_yuv_mmx.c Sat Feb 12 19:16:09 2011 -0800
209.3 @@ -1,6 +1,6 @@
209.4 /*
209.5 SDL - Simple DirectMedia Layer
209.6 - Copyright (C) 1997-2010 Sam Lantinga
209.7 + Copyright (C) 1997-2011 Sam Lantinga
209.8
209.9 This library is free software; you can redistribute it and/or
209.10 modify it under the terms of the GNU Lesser General Public
210.1 --- a/src/render/SDL_yuv_sw.c Sun Feb 06 23:48:31 2011 -0800
210.2 +++ b/src/render/SDL_yuv_sw.c Sat Feb 12 19:16:09 2011 -0800
210.3 @@ -1,6 +1,6 @@
210.4 /*
210.5 SDL - Simple DirectMedia Layer
210.6 - Copyright (C) 1997-2010 Sam Lantinga
210.7 + Copyright (C) 1997-2011 Sam Lantinga
210.8
210.9 This library is free software; you can redistribute it and/or
210.10 modify it under the terms of the GNU Lesser General Public
210.11 @@ -1127,7 +1127,8 @@
210.12 ("YV12 and IYUV textures only support full surface updates");
210.13 return -1;
210.14 }
210.15 - SDL_memcpy(swdata->pixels, pixels, swdata->h * swdata->w * 2);
210.16 + SDL_memcpy(swdata->pixels, pixels,
210.17 + (swdata->h * swdata->w) + (swdata->h * swdata->w) / 2);
210.18 break;
210.19 case SDL_PIXELFORMAT_YUY2:
210.20 case SDL_PIXELFORMAT_UYVY:
211.1 --- a/src/render/SDL_yuv_sw_c.h Sun Feb 06 23:48:31 2011 -0800
211.2 +++ b/src/render/SDL_yuv_sw_c.h Sat Feb 12 19:16:09 2011 -0800
211.3 @@ -1,6 +1,6 @@
211.4 /*
211.5 SDL - Simple DirectMedia Layer
211.6 - Copyright (C) 1997-2010 Sam Lantinga
211.7 + Copyright (C) 1997-2011 Sam Lantinga
211.8
211.9 This library is free software; you can redistribute it and/or
211.10 modify it under the terms of the GNU Lesser General Public
212.1 --- a/src/render/direct3d/SDL_render_d3d.c Sun Feb 06 23:48:31 2011 -0800
212.2 +++ b/src/render/direct3d/SDL_render_d3d.c Sat Feb 12 19:16:09 2011 -0800
212.3 @@ -1,6 +1,6 @@
212.4 /*
212.5 SDL - Simple DirectMedia Layer
212.6 - Copyright (C) 1997-2010 Sam Lantinga
212.7 + Copyright (C) 1997-2011 Sam Lantinga
212.8
212.9 This library is free software; you can redistribute it and/or
212.10 modify it under the terms of the GNU Lesser General Public
212.11 @@ -21,7 +21,8 @@
212.12 */
212.13 #include "SDL_config.h"
212.14
212.15 -#if SDL_VIDEO_RENDER_D3D
212.16 +#if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED
212.17 +
212.18
212.19 #include "../../core/windows/SDL_windows.h"
212.20
212.21 @@ -96,6 +97,7 @@
212.22 static int D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
212.23 const SDL_Rect * rect, void **pixels, int *pitch);
212.24 static void D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
212.25 +static void D3D_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect);
212.26 static int D3D_RenderDrawPoints(SDL_Renderer * renderer,
212.27 const SDL_Point * points, int count);
212.28 static int D3D_RenderDrawLines(SDL_Renderer * renderer,
212.29 @@ -308,6 +310,7 @@
212.30 renderer->UpdateTexture = D3D_UpdateTexture;
212.31 renderer->LockTexture = D3D_LockTexture;
212.32 renderer->UnlockTexture = D3D_UnlockTexture;
212.33 + renderer->SetClipRect = D3D_SetClipRect;
212.34 renderer->RenderDrawPoints = D3D_RenderDrawPoints;
212.35 renderer->RenderDrawLines = D3D_RenderDrawLines;
212.36 renderer->RenderFillRects = D3D_RenderFillRects;
212.37 @@ -602,6 +605,27 @@
212.38 }
212.39
212.40 static void
212.41 +D3D_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
212.42 +{
212.43 + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
212.44 +
212.45 + if (rect) {
212.46 + RECT d3drect;
212.47 +
212.48 + d3drect.left = rect->x;
212.49 + d3drect.right = rect->x + rect->w;
212.50 + d3drect.top = rect->y;
212.51 + d3drect.bottom = rect->y + rect->h;
212.52 + IDirect3DDevice9_SetScissorRect(data->device, &d3drect);
212.53 + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE,
212.54 + TRUE);
212.55 + } else {
212.56 + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE,
212.57 + FALSE);
212.58 + }
212.59 +}
212.60 +
212.61 +static void
212.62 D3D_SetBlendMode(D3D_RenderData * data, int blendMode)
212.63 {
212.64 switch (blendMode) {
212.65 @@ -1043,6 +1067,6 @@
212.66 SDL_free(renderer);
212.67 }
212.68
212.69 -#endif /* SDL_VIDEO_RENDER_D3D */
212.70 +#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
212.71
212.72 /* vi: set ts=4 sw=4 expandtab: */
213.1 --- a/src/render/opengl/SDL_glfuncs.h Sun Feb 06 23:48:31 2011 -0800
213.2 +++ b/src/render/opengl/SDL_glfuncs.h Sat Feb 12 19:16:09 2011 -0800
213.3 @@ -337,8 +337,7 @@
213.4 (GLfloat angle, GLfloat x, GLfloat y, GLfloat z))
213.5 SDL_PROC_UNUSED(void, glScaled, (GLdouble x, GLdouble y, GLdouble z))
213.6 SDL_PROC_UNUSED(void, glScalef, (GLfloat x, GLfloat y, GLfloat z))
213.7 -SDL_PROC_UNUSED(void, glScissor,
213.8 - (GLint x, GLint y, GLsizei width, GLsizei height))
213.9 +SDL_PROC(void, glScissor, (GLint x, GLint y, GLsizei width, GLsizei height))
213.10 SDL_PROC_UNUSED(void, glSelectBuffer, (GLsizei size, GLuint * buffer))
213.11 SDL_PROC_UNUSED(void, glShadeModel, (GLenum mode))
213.12 SDL_PROC_UNUSED(void, glStencilFunc, (GLenum func, GLint ref, GLuint mask))
214.1 --- a/src/render/opengl/SDL_render_gl.c Sun Feb 06 23:48:31 2011 -0800
214.2 +++ b/src/render/opengl/SDL_render_gl.c Sat Feb 12 19:16:09 2011 -0800
214.3 @@ -1,6 +1,6 @@
214.4 /*
214.5 SDL - Simple DirectMedia Layer
214.6 - Copyright (C) 1997-2010 Sam Lantinga
214.7 + Copyright (C) 1997-2011 Sam Lantinga
214.8
214.9 This library is free software; you can redistribute it and/or
214.10 modify it under the terms of the GNU Lesser General Public
214.11 @@ -21,10 +21,13 @@
214.12 */
214.13 #include "SDL_config.h"
214.14
214.15 -#if SDL_VIDEO_RENDER_OGL
214.16 +#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
214.17
214.18 +#include "SDL_hints.h"
214.19 +#include "SDL_log.h"
214.20 #include "SDL_opengl.h"
214.21 #include "../SDL_sysrender.h"
214.22 +#include "SDL_shaders_gl.h"
214.23
214.24 #ifdef __MACOSX__
214.25 #include <OpenGL/OpenGL.h>
214.26 @@ -52,6 +55,7 @@
214.27 static int GL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
214.28 const SDL_Rect * rect, void **pixels, int *pitch);
214.29 static void GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
214.30 +static void GL_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect);
214.31 static int GL_RenderClear(SDL_Renderer * renderer);
214.32 static int GL_RenderDrawPoints(SDL_Renderer * renderer,
214.33 const SDL_Point * points, int count);
214.34 @@ -93,6 +97,15 @@
214.35
214.36 void (*glTextureRangeAPPLE) (GLenum target, GLsizei length,
214.37 const GLvoid * pointer);
214.38 +
214.39 + /* Multitexture support */
214.40 + SDL_bool GL_ARB_multitexture_supported;
214.41 + PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
214.42 + int num_texture_units;
214.43 +
214.44 + /* Shader support */
214.45 + GL_ShaderContext *shaders;
214.46 +
214.47 } GL_RenderData;
214.48
214.49 typedef struct
214.50 @@ -105,6 +118,12 @@
214.51 GLenum formattype;
214.52 void *pixels;
214.53 int pitch;
214.54 + SDL_Rect locked_rect;
214.55 +
214.56 + /* YV12 texture support */
214.57 + SDL_bool yuv;
214.58 + GLuint utexture;
214.59 + GLuint vtexture;
214.60 } GL_TextureData;
214.61
214.62
214.63 @@ -171,6 +190,7 @@
214.64 {
214.65 SDL_Renderer *renderer;
214.66 GL_RenderData *data;
214.67 + const char *hint;
214.68 GLint value;
214.69 Uint32 window_flags;
214.70
214.71 @@ -199,6 +219,7 @@
214.72 renderer->UpdateTexture = GL_UpdateTexture;
214.73 renderer->LockTexture = GL_LockTexture;
214.74 renderer->UnlockTexture = GL_UnlockTexture;
214.75 + renderer->SetClipRect = GL_SetClipRect;
214.76 renderer->RenderClear = GL_RenderClear;
214.77 renderer->RenderDrawPoints = GL_RenderDrawPoints;
214.78 renderer->RenderDrawLines = GL_RenderDrawLines;
214.79 @@ -259,17 +280,35 @@
214.80 SDL_GL_GetProcAddress("glTextureRangeAPPLE");
214.81 }
214.82
214.83 + /* Check for multitexture support */
214.84 + if (SDL_GL_ExtensionSupported("GL_ARB_multitexture")) {
214.85 + data->glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) SDL_GL_GetProcAddress("glActiveTextureARB");
214.86 + if (data->glActiveTextureARB) {
214.87 + data->GL_ARB_multitexture_supported = SDL_TRUE;
214.88 + data->glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &data->num_texture_units);
214.89 + }
214.90 + }
214.91 +
214.92 + /* Check for shader support */
214.93 + hint = SDL_GetHint(SDL_HINT_RENDER_OPENGL_SHADERS);
214.94 + if (!hint || *hint != '0') {
214.95 + data->shaders = GL_CreateShaderContext();
214.96 + }
214.97 + SDL_LogInfo(SDL_LOG_CATEGORY_RENDER, "OpenGL shaders: %s",
214.98 + data->shaders ? "ENABLED" : "DISABLED");
214.99 +
214.100 + /* We support YV12 textures using 3 textures and a shader */
214.101 + if (data->shaders && data->num_texture_units >= 3) {
214.102 + renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_YV12;
214.103 + renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV;
214.104 + }
214.105 +
214.106 /* Set up parameters for rendering */
214.107 data->blendMode = -1;
214.108 data->glDisable(GL_DEPTH_TEST);
214.109 data->glDisable(GL_CULL_FACE);
214.110 /* This ended up causing video discrepancies between OpenGL and Direct3D */
214.111 /*data->glEnable(GL_LINE_SMOOTH);*/
214.112 - if (data->GL_ARB_texture_rectangle_supported) {
214.113 - data->glEnable(GL_TEXTURE_RECTANGLE_ARB);
214.114 - } else {
214.115 - data->glEnable(GL_TEXTURE_2D);
214.116 - }
214.117 data->updateSize = SDL_TRUE;
214.118
214.119 return renderer;
214.120 @@ -337,6 +376,12 @@
214.121 *format = GL_BGRA;
214.122 *type = GL_UNSIGNED_INT_8_8_8_8_REV;
214.123 break;
214.124 + case SDL_PIXELFORMAT_YV12:
214.125 + case SDL_PIXELFORMAT_IYUV:
214.126 + *internalFormat = GL_LUMINANCE;
214.127 + *format = GL_LUMINANCE;
214.128 + *type = GL_UNSIGNED_BYTE;
214.129 + break;
214.130 default:
214.131 return SDL_FALSE;
214.132 }
214.133 @@ -369,8 +414,15 @@
214.134 }
214.135
214.136 if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
214.137 + size_t size;
214.138 data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
214.139 - data->pixels = SDL_malloc(texture->h * data->pitch);
214.140 + size = texture->h * data->pitch;
214.141 + if (texture->format == SDL_PIXELFORMAT_YV12 ||
214.142 + texture->format == SDL_PIXELFORMAT_IYUV) {
214.143 + /* Need to add size for the U and V planes */
214.144 + size += (2 * (texture->h * data->pitch) / 4);
214.145 + }
214.146 + data->pixels = SDL_malloc(size);
214.147 if (!data->pixels) {
214.148 SDL_OutOfMemory();
214.149 SDL_free(data);
214.150 @@ -443,16 +495,42 @@
214.151 GL_SetError("glTexImage2D()", result);
214.152 return -1;
214.153 }
214.154 - return 0;
214.155 -}
214.156 +
214.157 + if (texture->format == SDL_PIXELFORMAT_YV12 ||
214.158 + texture->format == SDL_PIXELFORMAT_IYUV) {
214.159 + data->yuv = SDL_TRUE;
214.160 +
214.161 + renderdata->glGenTextures(1, &data->utexture);
214.162 + renderdata->glGenTextures(1, &data->vtexture);
214.163 + renderdata->glEnable(data->type);
214.164
214.165 -static void
214.166 -SetupTextureUpdate(GL_RenderData * renderdata, SDL_Texture * texture,
214.167 - int pitch)
214.168 -{
214.169 - renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
214.170 - renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH,
214.171 - (pitch / SDL_BYTESPERPIXEL(texture->format)));
214.172 + renderdata->glBindTexture(data->type, data->utexture);
214.173 + renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER,
214.174 + GL_LINEAR);
214.175 + renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER,
214.176 + GL_LINEAR);
214.177 + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S,
214.178 + GL_CLAMP_TO_EDGE);
214.179 + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T,
214.180 + GL_CLAMP_TO_EDGE);
214.181 + renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w/2,
214.182 + texture_h/2, 0, format, type, NULL);
214.183 +
214.184 + renderdata->glBindTexture(data->type, data->vtexture);
214.185 + renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER,
214.186 + GL_LINEAR);
214.187 + renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER,
214.188 + GL_LINEAR);
214.189 + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S,
214.190 + GL_CLAMP_TO_EDGE);
214.191 + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T,
214.192 + GL_CLAMP_TO_EDGE);
214.193 + renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w/2,
214.194 + texture_h/2, 0, format, type, NULL);
214.195 +
214.196 + renderdata->glDisable(data->type);
214.197 + }
214.198 + return 0;
214.199 }
214.200
214.201 static int
214.202 @@ -466,12 +544,47 @@
214.203 GL_ActivateRenderer(renderer);
214.204
214.205 renderdata->glGetError();
214.206 - SetupTextureUpdate(renderdata, texture, pitch);
214.207 + renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
214.208 + renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH,
214.209 + (pitch / SDL_BYTESPERPIXEL(texture->format)));
214.210 renderdata->glEnable(data->type);
214.211 renderdata->glBindTexture(data->type, data->texture);
214.212 renderdata->glTexSubImage2D(data->type, 0, rect->x, rect->y, rect->w,
214.213 rect->h, data->format, data->formattype,
214.214 pixels);
214.215 + if (data->yuv) {
214.216 + const void *top;
214.217 +
214.218 + renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, (pitch / 2));
214.219 +
214.220 + /* Skip to the top of the next texture */
214.221 + top = (const void*)((const Uint8*)pixels + (texture->h-rect->y) * pitch - rect->x);
214.222 +
214.223 + /* Skip to the correct offset into the next texture */
214.224 + pixels = (const void*)((const Uint8*)top + (rect->y / 2) * pitch + rect->x / 2);
214.225 + if (texture->format == SDL_PIXELFORMAT_YV12) {
214.226 + renderdata->glBindTexture(data->type, data->vtexture);
214.227 + } else {
214.228 + renderdata->glBindTexture(data->type, data->utexture);
214.229 + }
214.230 + renderdata->glTexSubImage2D(data->type, 0, rect->x/2, rect->y/2,
214.231 + rect->w/2, rect->h/2,
214.232 + data->format, data->formattype, pixels);
214.233 +
214.234 + /* Skip to the top of the next texture */
214.235 + top = (const void*)((const Uint8*)top + (texture->h * pitch)/4);
214.236 +
214.237 + /* Skip to the correct offset into the next texture */
214.238 + pixels = (const void*)((const Uint8*)top + (rect->y / 2) * pitch + rect->x / 2);
214.239 + if (texture->format == SDL_PIXELFORMAT_YV12) {
214.240 + renderdata->glBindTexture(data->type, data->utexture);
214.241 + } else {
214.242 + renderdata->glBindTexture(data->type, data->vtexture);
214.243 + }
214.244 + renderdata->glTexSubImage2D(data->type, 0, rect->x/2, rect->y/2,
214.245 + rect->w/2, rect->h/2,
214.246 + data->format, data->formattype, pixels);
214.247 + }
214.248 renderdata->glDisable(data->type);
214.249 result = renderdata->glGetError();
214.250 if (result != GL_NO_ERROR) {
214.251 @@ -487,7 +600,8 @@
214.252 {
214.253 GL_TextureData *data = (GL_TextureData *) texture->driverdata;
214.254
214.255 - *pixels =
214.256 + data->locked_rect = *rect;
214.257 + *pixels =
214.258 (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
214.259 rect->x * SDL_BYTESPERPIXEL(texture->format));
214.260 *pitch = data->pitch;
214.261 @@ -497,17 +611,33 @@
214.262 static void
214.263 GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
214.264 {
214.265 - GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata;
214.266 GL_TextureData *data = (GL_TextureData *) texture->driverdata;
214.267 + const SDL_Rect *rect;
214.268 + void *pixels;
214.269 +
214.270 + rect = &data->locked_rect;
214.271 + pixels =
214.272 + (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
214.273 + rect->x * SDL_BYTESPERPIXEL(texture->format));
214.274 + GL_UpdateTexture(renderer, texture, rect, pixels, data->pitch);
214.275 +}
214.276 +
214.277 +static void
214.278 +GL_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
214.279 +{
214.280 + GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
214.281
214.282 GL_ActivateRenderer(renderer);
214.283
214.284 - SetupTextureUpdate(renderdata, texture, data->pitch);
214.285 - renderdata->glEnable(data->type);
214.286 - renderdata->glBindTexture(data->type, data->texture);
214.287 - renderdata->glTexSubImage2D(data->type, 0, 0, 0, texture->w, texture->h,
214.288 - data->format, data->formattype, data->pixels);
214.289 - renderdata->glDisable(data->type);
214.290 + if (rect) {
214.291 + int w, h;
214.292 +
214.293 + SDL_GetWindowSize(renderer->window, &w, &h);
214.294 + data->glScissor(rect->x, (h-(rect->y+rect->h)), rect->w, rect->h);
214.295 + data->glEnable(GL_SCISSOR_TEST);
214.296 + } else {
214.297 + data->glDisable(GL_SCISSOR_TEST);
214.298 + }
214.299 }
214.300
214.301 static void
214.302 @@ -566,6 +696,7 @@
214.303 GL_ActivateRenderer(renderer);
214.304
214.305 GL_SetBlendMode(data, renderer->blendMode);
214.306 + GL_SelectShader(data->shaders, SHADER_SOLID);
214.307
214.308 data->glColor4f((GLfloat) renderer->r * inv255f,
214.309 (GLfloat) renderer->g * inv255f,
214.310 @@ -591,6 +722,7 @@
214.311 GL_ActivateRenderer(renderer);
214.312
214.313 GL_SetBlendMode(data, renderer->blendMode);
214.314 + GL_SelectShader(data->shaders, SHADER_SOLID);
214.315
214.316 data->glColor4f((GLfloat) renderer->r * inv255f,
214.317 (GLfloat) renderer->g * inv255f,
214.318 @@ -661,6 +793,7 @@
214.319 GL_ActivateRenderer(renderer);
214.320
214.321 GL_SetBlendMode(data, renderer->blendMode);
214.322 + GL_SelectShader(data->shaders, SHADER_SOLID);
214.323
214.324 data->glColor4f((GLfloat) renderer->r * inv255f,
214.325 (GLfloat) renderer->g * inv255f,
214.326 @@ -702,6 +835,13 @@
214.327 maxv *= texturedata->texh;
214.328
214.329 data->glEnable(texturedata->type);
214.330 + if (texturedata->yuv) {
214.331 + data->glActiveTextureARB(GL_TEXTURE2_ARB);
214.332 + data->glBindTexture(texturedata->type, texturedata->vtexture);
214.333 + data->glActiveTextureARB(GL_TEXTURE1_ARB);
214.334 + data->glBindTexture(texturedata->type, texturedata->utexture);
214.335 + data->glActiveTextureARB(GL_TEXTURE0_ARB);
214.336 + }
214.337 data->glBindTexture(texturedata->type, texturedata->texture);
214.338
214.339 if (texture->modMode) {
214.340 @@ -714,6 +854,11 @@
214.341 }
214.342
214.343 GL_SetBlendMode(data, texture->blendMode);
214.344 + if (texturedata->yuv) {
214.345 + GL_SelectShader(data->shaders, SHADER_YV12);
214.346 + } else {
214.347 + GL_SelectShader(data->shaders, SHADER_RGB);
214.348 + }
214.349
214.350 data->glBegin(GL_TRIANGLE_STRIP);
214.351 data->glTexCoord2f(minu, minv);
214.352 @@ -799,6 +944,10 @@
214.353 if (data->texture) {
214.354 renderdata->glDeleteTextures(1, &data->texture);
214.355 }
214.356 + if (data->yuv) {
214.357 + renderdata->glDeleteTextures(1, &data->utexture);
214.358 + renderdata->glDeleteTextures(1, &data->vtexture);
214.359 + }
214.360 if (data->pixels) {
214.361 SDL_free(data->pixels);
214.362 }
214.363 @@ -821,6 +970,6 @@
214.364 SDL_free(renderer);
214.365 }
214.366
214.367 -#endif /* SDL_VIDEO_RENDER_OGL */
214.368 +#endif /* SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED */
214.369
214.370 /* vi: set ts=4 sw=4 expandtab: */
215.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
215.2 +++ b/src/render/opengl/SDL_shaders_gl.c Sat Feb 12 19:16:09 2011 -0800
215.3 @@ -0,0 +1,371 @@
215.4 +/*
215.5 + SDL - Simple DirectMedia Layer
215.6 + Copyright (C) 1997-2011 Sam Lantinga
215.7 +
215.8 + This library is free software; you can redistribute it and/or
215.9 + modify it under the terms of the GNU Lesser General Public
215.10 + License as published by the Free Software Foundation; either
215.11 + version 2.1 of the License, or (at your option) any later version.
215.12 +
215.13 + This library is distributed in the hope that it will be useful,
215.14 + but WITHOUT ANY WARRANTY; without even the implied warranty of
215.15 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
215.16 + Lesser General Public License for more details.
215.17 +
215.18 + You should have received a copy of the GNU Lesser General Public
215.19 + License along with this library; if not, write to the Free Software
215.20 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
215.21 +
215.22 + Sam Lantinga
215.23 + slouken@libsdl.org
215.24 +*/
215.25 +#include "SDL_config.h"
215.26 +
215.27 +#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
215.28 +
215.29 +#include "SDL_stdinc.h"
215.30 +#include "SDL_log.h"
215.31 +#include "SDL_opengl.h"
215.32 +#include "SDL_video.h"
215.33 +#include "SDL_shaders_gl.h"
215.34 +
215.35 +/* OpenGL shader implementation */
215.36 +
215.37 +/*#define DEBUG_SHADERS*/
215.38 +
215.39 +typedef struct
215.40 +{
215.41 + GLenum program;
215.42 + GLenum vert_shader;
215.43 + GLenum frag_shader;
215.44 +} GL_ShaderData;
215.45 +
215.46 +struct GL_ShaderContext
215.47 +{
215.48 + GLenum (*glGetError)(void);
215.49 +
215.50 + PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
215.51 + PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
215.52 + PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
215.53 + PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
215.54 + PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
215.55 + PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
215.56 + PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
215.57 + PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
215.58 + PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
215.59 + PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
215.60 + PFNGLUNIFORM1IARBPROC glUniform1iARB;
215.61 + PFNGLUNIFORM1FARBPROC glUniform1fARB;
215.62 + PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
215.63 +
215.64 + SDL_bool GL_ARB_texture_rectangle_supported;
215.65 +
215.66 + GL_Shader current_shader;
215.67 + GL_ShaderData shaders[NUM_SHADERS];
215.68 +};
215.69 +
215.70 +/*
215.71 + * NOTE: Always use sampler2D, etc here. We'll #define them to the
215.72 + * texture_rectangle versions if we choose to use that extension.
215.73 + */
215.74 +static const char *shader_source[NUM_SHADERS][2] =
215.75 +{
215.76 + /* SHADER_NONE */
215.77 + { NULL, NULL },
215.78 +
215.79 + /* SHADER_SOLID */
215.80 + {
215.81 + /* vertex shader */
215.82 +"varying vec4 v_color;\n"
215.83 +"\n"
215.84 +"void main()\n"
215.85 +"{\n"
215.86 +" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
215.87 +" v_color = gl_Color;\n"
215.88 +"}",
215.89 + /* fragment shader */
215.90 +"varying vec4 v_color;\n"
215.91 +"\n"
215.92 +"void main()\n"
215.93 +"{\n"
215.94 +" gl_FragColor = v_color;\n"
215.95 +"}"
215.96 + },
215.97 +
215.98 + /* SHADER_RGB */
215.99 + {
215.100 + /* vertex shader */
215.101 +"varying vec4 v_color;\n"
215.102 +"varying vec2 v_texCoord;\n"
215.103 +"\n"
215.104 +"void main()\n"
215.105 +"{\n"
215.106 +" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
215.107 +" v_color = gl_Color;\n"
215.108 +" v_texCoord = vec2(gl_MultiTexCoord0);\n"
215.109 +"}",
215.110 + /* fragment shader */
215.111 +"varying vec4 v_color;\n"
215.112 +"varying vec2 v_texCoord;\n"
215.113 +"uniform sampler2D tex0;\n"
215.114 +"\n"
215.115 +"void main()\n"
215.116 +"{\n"
215.117 +" gl_FragColor = texture2D(tex0, v_texCoord) * v_color;\n"
215.118 +"}"
215.119 + },
215.120 +
215.121 + /* SHADER_YV12 */
215.122 + {
215.123 + /* vertex shader */
215.124 +"varying vec4 v_color;\n"
215.125 +"varying vec2 v_texCoord;\n"
215.126 +"\n"
215.127 +"void main()\n"
215.128 +"{\n"
215.129 +" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
215.130 +" v_color = gl_Color;\n"
215.131 +" v_texCoord = vec2(gl_MultiTexCoord0);\n"
215.132 +"}",
215.133 + /* fragment shader */
215.134 +"varying vec4 v_color;\n"
215.135 +"varying vec2 v_texCoord;\n"
215.136 +"uniform sampler2D tex0; // Y \n"
215.137 +"uniform sampler2D tex1; // U \n"
215.138 +"uniform sampler2D tex2; // V \n"
215.139 +"\n"
215.140 +"// YUV offset \n"
215.141 +"const vec3 offset = vec3(-0.0625, -0.5, -0.5);\n"
215.142 +"\n"
215.143 +"// RGB coefficients \n"
215.144 +"const vec3 Rcoeff = vec3(1.164, 0.000, 1.596);\n"
215.145 +"const vec3 Gcoeff = vec3(1.164, -0.391, -0.813);\n"
215.146 +"const vec3 Bcoeff = vec3(1.164, 2.018, 0.000);\n"
215.147 +"\n"
215.148 +"void main()\n"
215.149 +"{\n"
215.150 +" vec2 tcoord;\n"
215.151 +" vec3 yuv, rgb;\n"
215.152 +"\n"
215.153 +" // Get the Y value \n"
215.154 +" tcoord = v_texCoord;\n"
215.155 +" yuv.x = texture2D(tex0, tcoord).r;\n"
215.156 +"\n"
215.157 +" // Get the U and V values \n"
215.158 +" tcoord *= 0.5;\n"
215.159 +" yuv.y = texture2D(tex1, tcoord).r;\n"
215.160 +" yuv.z = texture2D(tex2, tcoord).r;\n"
215.161 +"\n"
215.162 +" // Do the color transform \n"
215.163 +" yuv += offset;\n"
215.164 +" rgb.r = dot(yuv, Rcoeff);\n"
215.165 +" rgb.g = dot(yuv, Gcoeff);\n"
215.166 +" rgb.b = dot(yuv, Bcoeff);\n"
215.167 +"\n"
215.168 +" // That was easy. :) \n"
215.169 +" gl_FragColor = vec4(rgb, 1.0) * v_color;\n"
215.170 +"}"
215.171 + },
215.172 +};
215.173 +
215.174 +static SDL_bool
215.175 +CompileShader(GL_ShaderContext *ctx, GLenum shader, const char *defines, const char *source)
215.176 +{
215.177 + GLint status;
215.178 + const char *sources[2];
215.179 +
215.180 + sources[0] = defines;
215.181 + sources[1] = source;
215.182 +
215.183 + ctx->glShaderSourceARB(shader, SDL_arraysize(sources), sources, NULL);
215.184 + ctx->glCompileShaderARB(shader);
215.185 + ctx->glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &status);
215.186 + if (status == 0) {
215.187 + GLint length;
215.188 + char *info;
215.189 +
215.190 + ctx->glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length);
215.191 + info = SDL_stack_alloc(char, length+1);
215.192 + ctx->glGetInfoLogARB(shader, length, NULL, info);
215.193 + SDL_LogError(SDL_LOG_CATEGORY_RENDER,
215.194 + "Failed to compile shader:\n%s%s\n%s", defines, source, info);
215.195 +#ifdef DEBUG_SHADERS
215.196 + fprintf(stderr,
215.197 + "Failed to compile shader:\n%s%s\n%s", defines, source, info);
215.198 +#endif
215.199 + SDL_stack_free(info);
215.200 +
215.201 + return SDL_FALSE;
215.202 + } else {
215.203 + return SDL_TRUE;
215.204 + }
215.205 +}
215.206 +
215.207 +static SDL_bool
215.208 +CompileShaderProgram(GL_ShaderContext *ctx, int index, GL_ShaderData *data)
215.209 +{
215.210 + const int num_tmus_bound = 4;
215.211 + const char *vert_defines = "";
215.212 + const char *frag_defines = "";
215.213 + int i;
215.214 + GLint location;
215.215 +
215.216 + if (index == SHADER_NONE) {
215.217 + return SDL_TRUE;
215.218 + }
215.219 +
215.220 + ctx->glGetError();
215.221 +
215.222 + /* Make sure we use the correct sampler type for our texture type */
215.223 + if (ctx->GL_ARB_texture_rectangle_supported) {
215.224 + frag_defines =
215.225 +"#define sampler2D sampler2DRect\n"
215.226 +"#define texture2D texture2DRect\n";
215.227 + }
215.228 +
215.229 + /* Create one program object to rule them all */
215.230 + data->program = ctx->glCreateProgramObjectARB();
215.231 +
215.232 + /* Create the vertex shader */
215.233 + data->vert_shader = ctx->glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
215.234 + if (!CompileShader(ctx, data->vert_shader, vert_defines, shader_source[index][0])) {
215.235 + return SDL_FALSE;
215.236 + }
215.237 +
215.238 + /* Create the fragment shader */
215.239 + data->frag_shader = ctx->glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
215.240 + if (!CompileShader(ctx, data->frag_shader, frag_defines, shader_source[index][1])) {
215.241 + return SDL_FALSE;
215.242 + }
215.243 +
215.244 + /* ... and in the darkness bind them */
215.245 + ctx->glAttachObjectARB(data->program, data->vert_shader);
215.246 + ctx->glAttachObjectARB(data->program, data->frag_shader);
215.247 + ctx->glLinkProgramARB(data->program);
215.248 +
215.249 + /* Set up some uniform variables */
215.250 + ctx->glUseProgramObjectARB(data->program);
215.251 + for (i = 0; i < num_tmus_bound; ++i) {
215.252 + char tex_name[5];
215.253 + SDL_snprintf(tex_name, SDL_arraysize(tex_name), "tex%d", i);
215.254 + location = ctx->glGetUniformLocationARB(data->program, tex_name);
215.255 + if (location >= 0) {
215.256 + ctx->glUniform1iARB(location, i);
215.257 + }
215.258 + }
215.259 + ctx->glUseProgramObjectARB(0);
215.260 +
215.261 + return (ctx->glGetError() == GL_NO_ERROR);
215.262 +}
215.263 +
215.264 +static void
215.265 +DestroyShaderProgram(GL_ShaderContext *ctx, GL_ShaderData *data)
215.266 +{
215.267 + ctx->glDeleteObjectARB(data->vert_shader);
215.268 + ctx->glDeleteObjectARB(data->frag_shader);
215.269 + ctx->glDeleteObjectARB(data->program);
215.270 +}
215.271 +
215.272 +GL_ShaderContext *
215.273 +GL_CreateShaderContext()
215.274 +{
215.275 + GL_ShaderContext *ctx;
215.276 + SDL_bool shaders_supported;
215.277 + int i;
215.278 +
215.279 + ctx = (GL_ShaderContext *)SDL_calloc(1, sizeof(*ctx));
215.280 + if (!ctx) {
215.281 + return NULL;
215.282 + }
215.283 +
215.284 + if (SDL_GL_ExtensionSupported("GL_ARB_texture_rectangle")
215.285 + || SDL_GL_ExtensionSupported("GL_EXT_texture_rectangle")) {
215.286 + ctx->GL_ARB_texture_rectangle_supported = SDL_TRUE;
215.287 + }
215.288 +
215.289 + /* Check for shader support */
215.290 + shaders_supported = SDL_FALSE;
215.291 + if (SDL_GL_ExtensionSupported("GL_ARB_shader_objects") &&
215.292 + SDL_GL_ExtensionSupported("GL_ARB_shading_language_100") &&
215.293 + SDL_GL_ExtensionSupported("GL_ARB_vertex_shader") &&
215.294 + SDL_GL_ExtensionSupported("GL_ARB_fragment_shader")) {
215.295 + ctx->glGetError = (GLenum (*)(void)) SDL_GL_GetProcAddress("glGetError");
215.296 + ctx->glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) SDL_GL_GetProcAddress("glAttachObjectARB");
215.297 + ctx->glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) SDL_GL_GetProcAddress("glCompileShaderARB");
215.298 + ctx->glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glCreateProgramObjectARB");
215.299 + ctx->glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) SDL_GL_GetProcAddress("glCreateShaderObjectARB");
215.300 + ctx->glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) SDL_GL_GetProcAddress("glDeleteObjectARB");
215.301 + ctx->glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC) SDL_GL_GetProcAddress("glGetInfoLogARB");
215.302 + ctx->glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) SDL_GL_GetProcAddress("glGetObjectParameterivARB");
215.303 + ctx->glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) SDL_GL_GetProcAddress("glGetUniformLocationARB");
215.304 + ctx->glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) SDL_GL_GetProcAddress("glLinkProgramARB");
215.305 + ctx->glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) SDL_GL_GetProcAddress("glShaderSourceARB");
215.306 + ctx->glUniform1iARB = (PFNGLUNIFORM1IARBPROC) SDL_GL_GetProcAddress("glUniform1iARB");
215.307 + ctx->glUniform1fARB = (PFNGLUNIFORM1FARBPROC) SDL_GL_GetProcAddress("glUniform1fARB");
215.308 + ctx->glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glUseProgramObjectARB");
215.309 + if (ctx->glGetError &&
215.310 + ctx->glAttachObjectARB &&
215.311 + ctx->glCompileShaderARB &&
215.312 + ctx->glCreateProgramObjectARB &&
215.313 + ctx->glCreateShaderObjectARB &&
215.314 + ctx->glDeleteObjectARB &&
215.315 + ctx->glGetInfoLogARB &&
215.316 + ctx->glGetObjectParameterivARB &&
215.317 + ctx->glGetUniformLocationARB &&
215.318 + ctx->glLinkProgramARB &&
215.319 + ctx->glShaderSourceARB &&
215.320 + ctx->glUniform1iARB &&
215.321 + ctx->glUniform1fARB &&
215.322 + ctx->glUseProgramObjectARB) {
215.323 + shaders_supported = SDL_TRUE;
215.324 + }
215.325 + }
215.326 +
215.327 + if (!shaders_supported) {
215.328 + SDL_free(ctx);
215.329 + return NULL;
215.330 + }
215.331 +
215.332 + /* Compile all the shaders */
215.333 + for (i = 0; i < NUM_SHADERS; ++i) {
215.334 + if (!CompileShaderProgram(ctx, i, &ctx->shaders[i])) {
215.335 + GL_DestroyShaderContext(ctx);
215.336 + return NULL;
215.337 + }
215.338 + }
215.339 +
215.340 + /* We're done! */
215.341 + return ctx;
215.342 +}
215.343 +
215.344 +void
215.345 +GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader)
215.346 +{
215.347 + /* Nothing to do if there's no shader support */
215.348 + if (!ctx) {
215.349 + return;
215.350 + }
215.351 +
215.352 + /* Nothing to do if there's no shader change */
215.353 + if (shader == ctx->current_shader) {
215.354 + return;
215.355 + }
215.356 +
215.357 + ctx->glUseProgramObjectARB(ctx->shaders[shader].program);
215.358 + ctx->current_shader = shader;
215.359 +}
215.360 +
215.361 +void
215.362 +GL_DestroyShaderContext(GL_ShaderContext *ctx)
215.363 +{
215.364 + int i;
215.365 +
215.366 + for (i = 0; i < NUM_SHADERS; ++i) {
215.367 + DestroyShaderProgram(ctx, &ctx->shaders[i]);
215.368 + }
215.369 + SDL_free(ctx);
215.370 +}
215.371 +
215.372 +#endif /* SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED */
215.373 +
215.374 +/* vi: set ts=4 sw=4 expandtab: */
216.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
216.2 +++ b/src/render/opengl/SDL_shaders_gl.h Sat Feb 12 19:16:09 2011 -0800
216.3 @@ -0,0 +1,40 @@
216.4 +/*
216.5 + SDL - Simple DirectMedia Layer
216.6 + Copyright (C) 1997-2011 Sam Lantinga
216.7 +
216.8 + This library is free software; you can redistribute it and/or
216.9 + modify it under the terms of the GNU Lesser General Public
216.10 + License as published by the Free Software Foundation; either
216.11 + version 2.1 of the License, or (at your option) any later version.
216.12 +
216.13 + This library is distributed in the hope that it will be useful,
216.14 + but WITHOUT ANY WARRANTY; without even the implied warranty of
216.15 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
216.16 + Lesser General Public License for more details.
216.17 +
216.18 + You should have received a copy of the GNU Lesser General Public
216.19 + License along with this library; if not, write to the Free Software
216.20 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
216.21 +
216.22 + Sam Lantinga
216.23 + slouken@libsdl.org
216.24 +*/
216.25 +#include "SDL_config.h"
216.26 +
216.27 +/* OpenGL shader implementation */
216.28 +
216.29 +typedef enum {
216.30 + SHADER_NONE,
216.31 + SHADER_SOLID,
216.32 + SHADER_RGB,
216.33 + SHADER_YV12,
216.34 + NUM_SHADERS
216.35 +} GL_Shader;
216.36 +
216.37 +typedef struct GL_ShaderContext GL_ShaderContext;
216.38 +
216.39 +extern GL_ShaderContext * GL_CreateShaderContext();
216.40 +extern void GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader);
216.41 +extern void GL_DestroyShaderContext(GL_ShaderContext *ctx);
216.42 +
216.43 +/* vi: set ts=4 sw=4 expandtab: */
217.1 --- a/src/render/opengles/SDL_render_gles.c Sun Feb 06 23:48:31 2011 -0800
217.2 +++ b/src/render/opengles/SDL_render_gles.c Sat Feb 12 19:16:09 2011 -0800
217.3 @@ -1,6 +1,6 @@
217.4 /*
217.5 SDL - Simple DirectMedia Layer
217.6 - Copyright (C) 1997-2010 Sam Lantinga
217.7 + Copyright (C) 1997-2011 Sam Lantinga
217.8
217.9 This library is free software; you can redistribute it and/or
217.10 modify it under the terms of the GNU Lesser General Public
217.11 @@ -21,7 +21,7 @@
217.12 */
217.13 #include "SDL_config.h"
217.14
217.15 -#if SDL_VIDEO_RENDER_OGL_ES
217.16 +#if SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED
217.17
217.18 #include "SDL_opengles.h"
217.19 #include "../SDL_sysrender.h"
217.20 @@ -40,9 +40,6 @@
217.21
217.22 /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */
217.23
217.24 -/* Used to re-create the window with OpenGL capability */
217.25 -extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
217.26 -
217.27 static const float inv255f = 1.0f / 255.0f;
217.28
217.29 static SDL_Renderer *GLES_CreateRenderer(SDL_Window * window, Uint32 flags);
217.30 @@ -56,6 +53,7 @@
217.31 const SDL_Rect * rect, void **pixels, int *pitch);
217.32 static void GLES_UnlockTexture(SDL_Renderer * renderer,
217.33 SDL_Texture * texture);
217.34 +static void GLES_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect);
217.35 static int GLES_RenderDrawPoints(SDL_Renderer * renderer,
217.36 const SDL_Point * points, int count);
217.37 static int GLES_RenderDrawLines(SDL_Renderer * renderer,
217.38 @@ -145,14 +143,6 @@
217.39 SDL_Renderer *renderer;
217.40 GLES_RenderData *data;
217.41 GLint value;
217.42 - Uint32 window_flags;
217.43 -
217.44 - window_flags = SDL_GetWindowFlags(window);
217.45 - if (!(window_flags & SDL_WINDOW_OPENGL)) {
217.46 - if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
217.47 - return NULL;
217.48 - }
217.49 - }
217.50
217.51 renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
217.52 if (!renderer) {
217.53 @@ -172,6 +162,7 @@
217.54 renderer->UpdateTexture = GLES_UpdateTexture;
217.55 renderer->LockTexture = GLES_LockTexture;
217.56 renderer->UnlockTexture = GLES_UnlockTexture;
217.57 + renderer->SetClipRect = GLES_SetClipRect;
217.58 renderer->RenderDrawPoints = GLES_RenderDrawPoints;
217.59 renderer->RenderDrawLines = GLES_RenderDrawLines;
217.60 renderer->RenderFillRects = GLES_RenderFillRects;
217.61 @@ -291,7 +282,6 @@
217.62 static int
217.63 GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
217.64 {
217.65 - GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata;
217.66 GLES_TextureData *data;
217.67 GLint internalFormat;
217.68 GLenum format, type;
217.69 @@ -368,46 +358,60 @@
217.70 GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
217.71 const SDL_Rect * rect, const void *pixels, int pitch)
217.72 {
217.73 - GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata;
217.74 GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
217.75 - GLenum result;
217.76 - int bpp = SDL_BYTESPERPIXEL(texture->format);
217.77 - void * temp_buffer;
217.78 - void * temp_ptr;
217.79 - int i;
217.80 + Uint8 *blob = NULL;
217.81 + Uint8 *src;
217.82 + int srcPitch;
217.83 + int y;
217.84
217.85 GLES_ActivateRenderer(renderer);
217.86
217.87 + /* Bail out if we're supposed to update an empty rectangle */
217.88 + if (rect->w <= 0 || rect->h <= 0)
217.89 + return 0;
217.90 +
217.91 + /* Reformat the texture data into a tightly packed array */
217.92 + srcPitch = rect->w * SDL_BYTESPERPIXEL(texture->format);
217.93 + src = (Uint8 *)pixels;
217.94 + if (pitch != srcPitch)
217.95 + {
217.96 + blob = (Uint8 *)SDL_malloc(srcPitch * rect->h);
217.97 + if (!blob)
217.98 + {
217.99 + SDL_OutOfMemory();
217.100 + return -1;
217.101 + }
217.102 + src = blob;
217.103 + for (y = 0; y < rect->h; ++y)
217.104 + {
217.105 + SDL_memcpy(src, pixels, srcPitch);
217.106 + src += srcPitch;
217.107 + pixels = (Uint8 *)pixels + pitch;
217.108 + }
217.109 + src = blob;
217.110 + }
217.111 +
217.112 + /* Create a texture subimage with the supplied data */
217.113 glGetError();
217.114 - glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
217.115 glEnable(data->type);
217.116 glBindTexture(data->type, data->texture);
217.117 -
217.118 - if( rect->w * bpp == pitch ) {
217.119 - temp_buffer = (void *)pixels; /* No need to reformat */
217.120 - } else {
217.121 - /* Reformatting of mem area required */
217.122 - temp_buffer = SDL_malloc(rect->w * rect->h * bpp);
217.123 - temp_ptr = temp_buffer;
217.124 - for (i = 0; i < rect->h; i++) {
217.125 - SDL_memcpy(temp_ptr, pixels, rect->w * bpp);
217.126 - temp_ptr += rect->w * bpp;
217.127 - pixels += pitch;
217.128 - }
217.129 + glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
217.130 + glTexSubImage2D(data->type,
217.131 + 0,
217.132 + rect->x,
217.133 + rect->y,
217.134 + rect->w,
217.135 + rect->h,
217.136 + data->format,
217.137 + data->formattype,
217.138 + src);
217.139 + if (blob) {
217.140 + SDL_free(blob);
217.141 }
217.142
217.143 - glTexSubImage2D(data->type, 0, rect->x, rect->y, rect->w,
217.144 - rect->h, data->format, data->formattype,
217.145 - temp_buffer);
217.146 -
217.147 - if( temp_buffer != pixels ) {
217.148 - SDL_free(temp_buffer);
217.149 - }
217.150 -
217.151 - glDisable(data->type);
217.152 - result = glGetError();
217.153 - if (result != GL_NO_ERROR) {
217.154 - GLES_SetError("glTexSubImage2D()", result);
217.155 + if (glGetError() != GL_NO_ERROR)
217.156 + {
217.157 + SDL_SetError("Failed to update texture");
217.158 return -1;
217.159 }
217.160 return 0;
217.161 @@ -429,18 +433,31 @@
217.162 static void
217.163 GLES_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
217.164 {
217.165 - GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata;
217.166 GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
217.167 + SDL_Rect rect;
217.168
217.169 + /* We do whole texture updates, at least for now */
217.170 + rect.x = 0;
217.171 + rect.y = 0;
217.172 + rect.w = texture->w;
217.173 + rect.h = texture->h;
217.174 + GLES_UpdateTexture(renderer, texture, &rect, data->pixels, data->pitch);
217.175 +}
217.176 +
217.177 +static void
217.178 +GLES_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
217.179 +{
217.180 GLES_ActivateRenderer(renderer);
217.181
217.182 - glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
217.183 - glEnable(data->type);
217.184 - glBindTexture(data->type, data->texture);
217.185 - glTexSubImage2D(data->type, 0, 0, 0, texture->w,
217.186 - texture->h, data->format, data->formattype,
217.187 - data->pixels);
217.188 - glDisable(data->type);
217.189 + if (rect) {
217.190 + int w, h;
217.191 +
217.192 + SDL_GetWindowSize(renderer->window, &w, &h);
217.193 + glScissor(rect->x, (h-(rect->y+rect->h)), rect->w, rect->h);
217.194 + glEnable(GL_SCISSOR_TEST);
217.195 + } else {
217.196 + glDisable(GL_SCISSOR_TEST);
217.197 + }
217.198 }
217.199
217.200 static void
217.201 @@ -710,6 +727,6 @@
217.202 SDL_free(renderer);
217.203 }
217.204
217.205 -#endif /* SDL_VIDEO_RENDER_OGL_ES */
217.206 +#endif /* SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED */
217.207
217.208 /* vi: set ts=4 sw=4 expandtab: */
218.1 --- a/src/render/opengles2/SDL_render_gles2.c Sun Feb 06 23:48:31 2011 -0800
218.2 +++ b/src/render/opengles2/SDL_render_gles2.c Sat Feb 12 19:16:09 2011 -0800
218.3 @@ -1,29 +1,28 @@
218.4 /*
218.5 SDL - Simple DirectMedia Layer
218.6 + Copyright (C) 1997-2011 Sam Lantinga
218.7 Copyright (C) 2010 itsnotabigtruck.
218.8
218.9 - Permission is hereby granted, free of charge, to any person obtaining a
218.10 - copy of this software and associated documentation files (the "Software"),
218.11 - to deal in the Software without restriction, including without limitation
218.12 - the rights to use, copy, modify, merge, publish, distribute, sublicense,
218.13 - and/or sell copies of the Software, and to permit persons to whom the
218.14 - Software is furnished to do so, subject to the following conditions:
218.15 -
218.16 - The above copyright notice and this permission notice shall be included in
218.17 - all copies or substantial portions of the Software.
218.18 + This library is free software; you can redistribute it and/or
218.19 + modify it under the terms of the GNU Lesser General Public
218.20 + License as published by the Free Software Foundation; either
218.21 + version 2.1 of the License, or (at your option) any later version.
218.22
218.23 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
218.24 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
218.25 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
218.26 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
218.27 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
218.28 - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
218.29 - DEALINGS IN THE SOFTWARE.
218.30 + This library is distributed in the hope that it will be useful,
218.31 + but WITHOUT ANY WARRANTY; without even the implied warranty of
218.32 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
218.33 + Lesser General Public License for more details.
218.34 +
218.35 + You should have received a copy of the GNU Lesser General Public
218.36 + License along with this library; if not, write to the Free Software
218.37 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
218.38 +
218.39 + Sam Lantinga
218.40 + slouken@libsdl.org
218.41 */
218.42 -
218.43 #include "SDL_config.h"
218.44
218.45 -#if SDL_VIDEO_RENDER_OGL_ES2
218.46 +#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
218.47
218.48 #include "SDL_opengles2.h"
218.49 #include "../SDL_sysrender.h"
218.50 @@ -133,10 +132,10 @@
218.51 * Renderer state APIs *
218.52 *************************************************************************************************/
218.53
218.54 +static int GLES2_ActivateRenderer(SDL_Renderer *renderer);
218.55 static void GLES2_WindowEvent(SDL_Renderer * renderer,
218.56 const SDL_WindowEvent *event);
218.57 -static int GLES2_ActivateRenderer(SDL_Renderer *renderer);
218.58 -static int GLES2_DisplayModeChanged(SDL_Renderer *renderer);
218.59 +static void GLES2_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect);
218.60 static void GLES2_DestroyRenderer(SDL_Renderer *renderer);
218.61
218.62 static SDL_GLContext SDL_CurrentContext = NULL;
218.63 @@ -179,6 +178,22 @@
218.64 }
218.65
218.66 static void
218.67 +GLES2_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
218.68 +{
218.69 + GLES2_ActivateRenderer(renderer);
218.70 +
218.71 + if (rect) {
218.72 + int w, h;
218.73 +
218.74 + SDL_GetWindowSize(renderer->window, &w, &h);
218.75 + glScissor(rect->x, (h-(rect->y+rect->h)), rect->w, rect->h);
218.76 + glEnable(GL_SCISSOR_TEST);
218.77 + } else {
218.78 + glDisable(GL_SCISSOR_TEST);
218.79 + }
218.80 +}
218.81 +
218.82 +static void
218.83 GLES2_DestroyRenderer(SDL_Renderer *renderer)
218.84 {
218.85 GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata;
218.86 @@ -327,14 +342,14 @@
218.87 GLES2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture)
218.88 {
218.89 GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata;
218.90 -
218.91 - GLES2_ActivateRenderer(renderer);
218.92 + SDL_Rect rect;
218.93
218.94 - glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
218.95 - glActiveTexture(GL_TEXTURE0);
218.96 - glBindTexture(tdata->texture_type, tdata->texture);
218.97 - glTexSubImage2D(tdata->texture_type, 0, 0, 0, texture->w, texture->h,
218.98 - tdata->pixel_format, tdata->pixel_type, tdata->pixel_data);
218.99 + /* We do whole texture updates, at least for now */
218.100 + rect.x = 0;
218.101 + rect.y = 0;
218.102 + rect.w = texture->w;
218.103 + rect.h = texture->h;
218.104 + GLES2_UpdateTexture(renderer, texture, &rect, tdata->pixel_data, tdata->pitch);
218.105 }
218.106
218.107 static int
218.108 @@ -345,7 +360,6 @@
218.109 Uint8 *blob = NULL;
218.110 Uint8 *src;
218.111 int srcPitch;
218.112 - Uint8 *dest;
218.113 int y;
218.114
218.115 GLES2_ActivateRenderer(renderer);
218.116 @@ -389,7 +403,9 @@
218.117 tdata->pixel_format,
218.118 tdata->pixel_type,
218.119 src);
218.120 - SDL_free(blob);
218.121 + if (blob) {
218.122 + SDL_free(blob);
218.123 + }
218.124
218.125 if (glGetError() != GL_NO_ERROR)
218.126 {
218.127 @@ -761,6 +777,8 @@
218.128 * Rendering functions *
218.129 *************************************************************************************************/
218.130
218.131 +static const float inv255f = 1.0f / 255.0f;
218.132 +
218.133 static int GLES2_RenderClear(SDL_Renderer *renderer);
218.134 static int GLES2_RenderDrawPoints(SDL_Renderer *renderer, const SDL_Point *points, int count);
218.135 static int GLES2_RenderDrawLines(SDL_Renderer *renderer, const SDL_Point *points, int count);
218.136 @@ -772,10 +790,10 @@
218.137 static int
218.138 GLES2_RenderClear(SDL_Renderer *renderer)
218.139 {
218.140 - float r = (float)renderer->r / 255.0f;
218.141 - float g = (float)renderer->g / 255.0f;
218.142 - float b = (float)renderer->b / 255.0f;
218.143 - float a = (float)renderer->a / 255.0f;
218.144 + float r = (float)renderer->r * inv255f;
218.145 + float g = (float)renderer->g * inv255f;
218.146 + float b = (float)renderer->b * inv255f;
218.147 + float a = (float)renderer->a * inv255f;
218.148
218.149 GLES2_ActivateRenderer(renderer);
218.150
218.151 @@ -832,10 +850,10 @@
218.152 locColor = rdata->current_program->uniform_locations[GLES2_UNIFORM_COLOR];
218.153 glGetError();
218.154 glUniform4f(locColor,
218.155 - renderer->r / 255.0f,
218.156 - renderer->g / 255.0f,
218.157 - renderer->b / 255.0f,
218.158 - alpha / 255.0f);
218.159 + renderer->r * inv255f,
218.160 + renderer->g * inv255f,
218.161 + renderer->b * inv255f,
218.162 + alpha * inv255f);
218.163
218.164 /* Configure the correct blend mode */
218.165 GLES2_SetBlendMode(blendMode);
218.166 @@ -886,10 +904,10 @@
218.167 locColor = rdata->current_program->uniform_locations[GLES2_UNIFORM_COLOR];
218.168 glGetError();
218.169 glUniform4f(locColor,
218.170 - renderer->r / 255.0f,
218.171 - renderer->g / 255.0f,
218.172 - renderer->b / 255.0f,
218.173 - alpha / 255.0f);
218.174 + renderer->r * inv255f,
218.175 + renderer->g * inv255f,
218.176 + renderer->b * inv255f,
218.177 + alpha * inv255f);
218.178
218.179 /* Configure the correct blend mode */
218.180 GLES2_SetBlendMode(blendMode);
218.181 @@ -940,10 +958,10 @@
218.182 locColor = rdata->current_program->uniform_locations[GLES2_UNIFORM_COLOR];
218.183 glGetError();
218.184 glUniform4f(locColor,
218.185 - renderer->r / 255.0f,
218.186 - renderer->g / 255.0f,
218.187 - renderer->b / 255.0f,
218.188 - alpha / 255.0f);
218.189 + renderer->r * inv255f,
218.190 + renderer->g * inv255f,
218.191 + renderer->b * inv255f,
218.192 + alpha * inv255f);
218.193
218.194 /* Configure the correct blend mode */
218.195 GLES2_SetBlendMode(blendMode);
218.196 @@ -1014,10 +1032,10 @@
218.197 /* Configure color modulation */
218.198 locModulation = rdata->current_program->uniform_locations[GLES2_UNIFORM_MODULATION];
218.199 glUniform4f(locModulation,
218.200 - texture->r / 255.0f,
218.201 - texture->g / 255.0f,
218.202 - texture->b / 255.0f,
218.203 - alpha / 255.0f);
218.204 + texture->r * inv255f,
218.205 + texture->g * inv255f,
218.206 + texture->b * inv255f,
218.207 + alpha * inv255f);
218.208
218.209 /* Emit the textured quad */
218.210 glEnableVertexAttribArray(GLES2_ATTRIBUTE_TEXCOORD);
218.211 @@ -1160,6 +1178,7 @@
218.212 renderer->UpdateTexture = &GLES2_UpdateTexture;
218.213 renderer->LockTexture = &GLES2_LockTexture;
218.214 renderer->UnlockTexture = &GLES2_UnlockTexture;
218.215 + renderer->SetClipRect = &GLES2_SetClipRect;
218.216 renderer->RenderClear = &GLES2_RenderClear;
218.217 renderer->RenderDrawPoints = &GLES2_RenderDrawPoints;
218.218 renderer->RenderDrawLines = &GLES2_RenderDrawLines;
218.219 @@ -1171,6 +1190,6 @@
218.220 return renderer;
218.221 }
218.222
218.223 -#endif /* SDL_VIDEO_RENDER_OGL_ES2 */
218.224 +#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */
218.225
218.226 /* vi: set ts=4 sw=4 expandtab: */
219.1 --- a/src/render/opengles2/SDL_shaders_gles2.c Sun Feb 06 23:48:31 2011 -0800
219.2 +++ b/src/render/opengles2/SDL_shaders_gles2.c Sat Feb 12 19:16:09 2011 -0800
219.3 @@ -1,29 +1,28 @@
219.4 /*
219.5 SDL - Simple DirectMedia Layer
219.6 + Copyright (C) 1997-2011 Sam Lantinga
219.7 Copyright (C) 2010 itsnotabigtruck.
219.8
219.9 - Permission is hereby granted, free of charge, to any person obtaining a
219.10 - copy of this software and associated documentation files (the "Software"),
219.11 - to deal in the Software without restriction, including without limitation
219.12 - the rights to use, copy, modify, merge, publish, distribute, sublicense,
219.13 - and/or sell copies of the Software, and to permit persons to whom the
219.14 - Software is furnished to do so, subject to the following conditions:
219.15 -
219.16 - The above copyright notice and this permission notice shall be included in
219.17 - all copies or substantial portions of the Software.
219.18 + This library is free software; you can redistribute it and/or
219.19 + modify it under the terms of the GNU Lesser General Public
219.20 + License as published by the Free Software Foundation; either
219.21 + version 2.1 of the License, or (at your option) any later version.
219.22
219.23 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
219.24 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
219.25 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
219.26 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
219.27 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
219.28 - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
219.29 - DEALINGS IN THE SOFTWARE.
219.30 + This library is distributed in the hope that it will be useful,
219.31 + but WITHOUT ANY WARRANTY; without even the implied warranty of
219.32 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
219.33 + Lesser General Public License for more details.
219.34 +
219.35 + You should have received a copy of the GNU Lesser General Public
219.36 + License along with this library; if not, write to the Free Software
219.37 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
219.38 +
219.39 + Sam Lantinga
219.40 + slouken@libsdl.org
219.41 */
219.42 -
219.43 #include "SDL_config.h"
219.44
219.45 -#if SDL_VIDEO_RENDER_OGL_ES2
219.46 +#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
219.47
219.48 #include "SDL_video.h"
219.49 #include "SDL_opengles2.h"
219.50 @@ -539,6 +538,6 @@
219.51 }
219.52 }
219.53
219.54 -#endif /* SDL_VIDEO_RENDER_OGL_ES2 */
219.55 +#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */
219.56
219.57 /* vi: set ts=4 sw=4 expandtab: */
220.1 --- a/src/render/opengles2/SDL_shaders_gles2.h Sun Feb 06 23:48:31 2011 -0800
220.2 +++ b/src/render/opengles2/SDL_shaders_gles2.h Sat Feb 12 19:16:09 2011 -0800
220.3 @@ -1,26 +1,25 @@
220.4 /*
220.5 SDL - Simple DirectMedia Layer
220.6 + Copyright (C) 1997-2011 Sam Lantinga
220.7 Copyright (C) 2010 itsnotabigtruck.
220.8
220.9 - Permission is hereby granted, free of charge, to any person obtaining a
220.10 - copy of this software and associated documentation files (the "Software"),
220.11 - to deal in the Software without restriction, including without limitation
220.12 - the rights to use, copy, modify, merge, publish, distribute, sublicense,
220.13 - and/or sell copies of the Software, and to permit persons to whom the
220.14 - Software is furnished to do so, subject to the following conditions:
220.15 -
220.16 - The above copyright notice and this permission notice shall be included in
220.17 - all copies or substantial portions of the Software.
220.18 + This library is free software; you can redistribute it and/or
220.19 + modify it under the terms of the GNU Lesser General Public
220.20 + License as published by the Free Software Foundation; either
220.21 + version 2.1 of the License, or (at your option) any later version.
220.22
220.23 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
220.24 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
220.25 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
220.26 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
220.27 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
220.28 - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
220.29 - DEALINGS IN THE SOFTWARE.
220.30 + This library is distributed in the hope that it will be useful,
220.31 + but WITHOUT ANY WARRANTY; without even the implied warranty of
220.32 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
220.33 + Lesser General Public License for more details.
220.34 +
220.35 + You should have received a copy of the GNU Lesser General Public
220.36 + License along with this library; if not, write to the Free Software
220.37 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
220.38 +
220.39 + Sam Lantinga
220.40 + slouken@libsdl.org
220.41 */
220.42 -
220.43 #include "SDL_config.h"
220.44
220.45 #if SDL_VIDEO_RENDER_OGL_ES2
221.1 --- a/src/render/software/SDL_blendfillrect.c Sun Feb 06 23:48:31 2011 -0800
221.2 +++ b/src/render/software/SDL_blendfillrect.c Sat Feb 12 19:16:09 2011 -0800
221.3 @@ -1,6 +1,6 @@
221.4 /*
221.5 SDL - Simple DirectMedia Layer
221.6 - Copyright (C) 1997-2010 Sam Lantinga
221.7 + Copyright (C) 1997-2011 Sam Lantinga
221.8
221.9 This library is free software; you can redistribute it and/or
221.10 modify it under the terms of the GNU Lesser General Public
221.11 @@ -21,6 +21,8 @@
221.12 */
221.13 #include "SDL_config.h"
221.14
221.15 +#if !SDL_RENDER_DISABLED
221.16 +
221.17 #include "SDL_draw.h"
221.18 #include "SDL_blendfillrect.h"
221.19
221.20 @@ -345,4 +347,6 @@
221.21 return status;
221.22 }
221.23
221.24 +#endif /* !SDL_RENDER_DISABLED */
221.25 +
221.26 /* vi: set ts=4 sw=4 expandtab: */
222.1 --- a/src/render/software/SDL_blendfillrect.h Sun Feb 06 23:48:31 2011 -0800
222.2 +++ b/src/render/software/SDL_blendfillrect.h Sat Feb 12 19:16:09 2011 -0800
222.3 @@ -1,6 +1,6 @@
222.4 /*
222.5 SDL - Simple DirectMedia Layer
222.6 - Copyright (C) 1997-2010 Sam Lantinga
222.7 + Copyright (C) 1997-2011 Sam Lantinga
222.8
222.9 This library is free software; you can redistribute it and/or
222.10 modify it under the terms of the GNU Lesser General Public
223.1 --- a/src/render/software/SDL_blendline.c Sun Feb 06 23:48:31 2011 -0800
223.2 +++ b/src/render/software/SDL_blendline.c Sat Feb 12 19:16:09 2011 -0800
223.3 @@ -1,6 +1,6 @@
223.4 /*
223.5 SDL - Simple DirectMedia Layer
223.6 - Copyright (C) 1997-2010 Sam Lantinga
223.7 + Copyright (C) 1997-2011 Sam Lantinga
223.8
223.9 This library is free software; you can redistribute it and/or
223.10 modify it under the terms of the GNU Lesser General Public
223.11 @@ -21,6 +21,8 @@
223.12 */
223.13 #include "SDL_config.h"
223.14
223.15 +#if !SDL_RENDER_DISABLED
223.16 +
223.17 #include "SDL_draw.h"
223.18 #include "SDL_blendline.h"
223.19 #include "SDL_blendpoint.h"
223.20 @@ -779,4 +781,6 @@
223.21 return 0;
223.22 }
223.23
223.24 +#endif /* !SDL_RENDER_DISABLED */
223.25 +
223.26 /* vi: set ts=4 sw=4 expandtab: */
224.1 --- a/src/render/software/SDL_blendline.h Sun Feb 06 23:48:31 2011 -0800
224.2 +++ b/src/render/software/SDL_blendline.h Sat Feb 12 19:16:09 2011 -0800
224.3 @@ -1,6 +1,6 @@
224.4 /*
224.5 SDL - Simple DirectMedia Layer
224.6 - Copyright (C) 1997-2010 Sam Lantinga
224.7 + Copyright (C) 1997-2011 Sam Lantinga
224.8
224.9 This library is free software; you can redistribute it and/or
224.10 modify it under the terms of the GNU Lesser General Public
225.1 --- a/src/render/software/SDL_blendpoint.c Sun Feb 06 23:48:31 2011 -0800
225.2 +++ b/src/render/software/SDL_blendpoint.c Sat Feb 12 19:16:09 2011 -0800
225.3 @@ -1,6 +1,6 @@
225.4 /*
225.5 SDL - Simple DirectMedia Layer
225.6 - Copyright (C) 1997-2010 Sam Lantinga
225.7 + Copyright (C) 1997-2011 Sam Lantinga
225.8
225.9 This library is free software; you can redistribute it and/or
225.10 modify it under the terms of the GNU Lesser General Public
225.11 @@ -21,6 +21,8 @@
225.12 */
225.13 #include "SDL_config.h"
225.14
225.15 +#if !SDL_RENDER_DISABLED
225.16 +
225.17 #include "SDL_draw.h"
225.18 #include "SDL_blendpoint.h"
225.19
225.20 @@ -343,4 +345,6 @@
225.21 return status;
225.22 }
225.23
225.24 +#endif /* !SDL_RENDER_DISABLED */
225.25 +
225.26 /* vi: set ts=4 sw=4 expandtab: */
226.1 --- a/src/render/software/SDL_blendpoint.h Sun Feb 06 23:48:31 2011 -0800
226.2 +++ b/src/render/software/SDL_blendpoint.h Sat Feb 12 19:16:09 2011 -0800
226.3 @@ -1,6 +1,6 @@
226.4 /*
226.5 SDL - Simple DirectMedia Layer
226.6 - Copyright (C) 1997-2010 Sam Lantinga
226.7 + Copyright (C) 1997-2011 Sam Lantinga
226.8
226.9 This library is free software; you can redistribute it and/or
226.10 modify it under the terms of the GNU Lesser General Public
227.1 --- a/src/render/software/SDL_draw.h Sun Feb 06 23:48:31 2011 -0800
227.2 +++ b/src/render/software/SDL_draw.h Sat Feb 12 19:16:09 2011 -0800
227.3 @@ -1,6 +1,6 @@
227.4 /*
227.5 SDL - Simple DirectMedia Layer
227.6 - Copyright (C) 1997-2010 Sam Lantinga
227.7 + Copyright (C) 1997-2011 Sam Lantinga
227.8
227.9 This library is free software; you can redistribute it and/or
227.10 modify it under the terms of the GNU Lesser General Public
228.1 --- a/src/render/software/SDL_drawline.c Sun Feb 06 23:48:31 2011 -0800
228.2 +++ b/src/render/software/SDL_drawline.c Sat Feb 12 19:16:09 2011 -0800
228.3 @@ -1,6 +1,6 @@
228.4 /*
228.5 SDL - Simple DirectMedia Layer
228.6 - Copyright (C) 1997-2010 Sam Lantinga
228.7 + Copyright (C) 1997-2011 Sam Lantinga
228.8
228.9 This library is free software; you can redistribute it and/or
228.10 modify it under the terms of the GNU Lesser General Public
228.11 @@ -21,6 +21,8 @@
228.12 */
228.13 #include "SDL_config.h"
228.14
228.15 +#if !SDL_RENDER_DISABLED
228.16 +
228.17 #include "SDL_draw.h"
228.18 #include "SDL_drawline.h"
228.19 #include "SDL_drawpoint.h"
228.20 @@ -208,4 +210,6 @@
228.21 return 0;
228.22 }
228.23
228.24 +#endif /* !SDL_RENDER_DISABLED */
228.25 +
228.26 /* vi: set ts=4 sw=4 expandtab: */
229.1 --- a/src/render/software/SDL_drawline.h Sun Feb 06 23:48:31 2011 -0800
229.2 +++ b/src/render/software/SDL_drawline.h Sat Feb 12 19:16:09 2011 -0800
229.3 @@ -1,6 +1,6 @@
229.4 /*
229.5 SDL - Simple DirectMedia Layer
229.6 - Copyright (C) 1997-2010 Sam Lantinga
229.7 + Copyright (C) 1997-2011 Sam Lantinga
229.8
229.9 This library is free software; you can redistribute it and/or
229.10 modify it under the terms of the GNU Lesser General Public
230.1 --- a/src/render/software/SDL_drawpoint.c Sun Feb 06 23:48:31 2011 -0800
230.2 +++ b/src/render/software/SDL_drawpoint.c Sat Feb 12 19:16:09 2011 -0800
230.3 @@ -1,6 +1,6 @@
230.4 /*
230.5 SDL - Simple DirectMedia Layer
230.6 - Copyright (C) 1997-2010 Sam Lantinga
230.7 + Copyright (C) 1997-2011 Sam Lantinga
230.8
230.9 This library is free software; you can redistribute it and/or
230.10 modify it under the terms of the GNU Lesser General Public
230.11 @@ -21,6 +21,8 @@
230.12 */
230.13 #include "SDL_config.h"
230.14
230.15 +#if !SDL_RENDER_DISABLED
230.16 +
230.17 #include "SDL_draw.h"
230.18 #include "SDL_drawpoint.h"
230.19
230.20 @@ -114,4 +116,6 @@
230.21 return 0;
230.22 }
230.23
230.24 +#endif /* !SDL_RENDER_DISABLED */
230.25 +
230.26 /* vi: set ts=4 sw=4 expandtab: */
231.1 --- a/src/render/software/SDL_drawpoint.h Sun Feb 06 23:48:31 2011 -0800
231.2 +++ b/src/render/software/SDL_drawpoint.h Sat Feb 12 19:16:09 2011 -0800
231.3 @@ -1,6 +1,6 @@
231.4 /*
231.5 SDL - Simple DirectMedia Layer
231.6 - Copyright (C) 1997-2010 Sam Lantinga
231.7 + Copyright (C) 1997-2011 Sam Lantinga
231.8
231.9 This library is free software; you can redistribute it and/or
231.10 modify it under the terms of the GNU Lesser General Public
232.1 --- a/src/render/software/SDL_render_sw.c Sun Feb 06 23:48:31 2011 -0800
232.2 +++ b/src/render/software/SDL_render_sw.c Sat Feb 12 19:16:09 2011 -0800
232.3 @@ -1,6 +1,6 @@
232.4 /*
232.5 SDL - Simple DirectMedia Layer
232.6 - Copyright (C) 1997-2010 Sam Lantinga
232.7 + Copyright (C) 1997-2011 Sam Lantinga
232.8
232.9 This library is free software; you can redistribute it and/or
232.10 modify it under the terms of the GNU Lesser General Public
232.11 @@ -21,6 +21,8 @@
232.12 */
232.13 #include "SDL_config.h"
232.14
232.15 +#if !SDL_RENDER_DISABLED
232.16 +
232.17 #include "../SDL_sysrender.h"
232.18 #include "../../video/SDL_pixels_c.h"
232.19
232.20 @@ -50,6 +52,7 @@
232.21 static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
232.22 const SDL_Rect * rect, void **pixels, int *pitch);
232.23 static void SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
232.24 +static void SW_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect);
232.25 static int SW_RenderDrawPoints(SDL_Renderer * renderer,
232.26 const SDL_Point * points, int count);
232.27 static int SW_RenderDrawLines(SDL_Renderer * renderer,
232.28 @@ -125,6 +128,7 @@
232.29 renderer->UpdateTexture = SW_UpdateTexture;
232.30 renderer->LockTexture = SW_LockTexture;
232.31 renderer->UnlockTexture = SW_UnlockTexture;
232.32 + renderer->SetClipRect = SW_SetClipRect;
232.33 renderer->DestroyTexture = SW_DestroyTexture;
232.34 renderer->RenderDrawPoints = SW_RenderDrawPoints;
232.35 renderer->RenderDrawLines = SW_RenderDrawLines;
232.36 @@ -266,6 +270,17 @@
232.37 {
232.38 }
232.39
232.40 +static void
232.41 +SW_SetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
232.42 +{
232.43 + SDL_Surface *surface = SW_ActivateRenderer(renderer);
232.44 +
232.45 + if (!surface) {
232.46 + return;
232.47 + }
232.48 + SDL_SetClipRect(surface, rect);
232.49 +}
232.50 +
232.51 static int
232.52 SW_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points,
232.53 int count)
232.54 @@ -415,4 +430,6 @@
232.55 SDL_free(renderer);
232.56 }
232.57
232.58 +#endif /* !SDL_RENDER_DISABLED */
232.59 +
232.60 /* vi: set ts=4 sw=4 expandtab: */
233.1 --- a/src/render/software/SDL_render_sw_c.h Sun Feb 06 23:48:31 2011 -0800
233.2 +++ b/src/render/software/SDL_render_sw_c.h Sat Feb 12 19:16:09 2011 -0800
233.3 @@ -1,6 +1,6 @@
233.4 /*
233.5 SDL - Simple DirectMedia Layer
233.6 - Copyright (C) 1997-2010 Sam Lantinga
233.7 + Copyright (C) 1997-2011 Sam Lantinga
233.8
233.9 This library is free software; you can redistribute it and/or
233.10 modify it under the terms of the GNU Lesser General Public
234.1 --- a/src/stdlib/SDL_getenv.c Sun Feb 06 23:48:31 2011 -0800
234.2 +++ b/src/stdlib/SDL_getenv.c Sat Feb 12 19:16:09 2011 -0800
234.3 @@ -1,6 +1,6 @@
234.4 /*
234.5 SDL - Simple DirectMedia Layer
234.6 - Copyright (C) 1997-2010 Sam Lantinga
234.7 + Copyright (C) 1997-2011 Sam Lantinga
234.8
234.9 This library is free software; you can redistribute it and/or
234.10 modify it under the terms of the GNU Lesser General Public
235.1 --- a/src/stdlib/SDL_iconv.c Sun Feb 06 23:48:31 2011 -0800
235.2 +++ b/src/stdlib/SDL_iconv.c Sat Feb 12 19:16:09 2011 -0800
235.3 @@ -1,6 +1,6 @@
235.4 /*
235.5 SDL - Simple DirectMedia Layer
235.6 - Copyright (C) 1997-2010 Sam Lantinga
235.7 + Copyright (C) 1997-2011 Sam Lantinga
235.8
235.9 This library is free software; you can redistribute it and/or
235.10 modify it under the terms of the GNU Lesser General Public
236.1 --- a/src/stdlib/SDL_malloc.c Sun Feb 06 23:48:31 2011 -0800
236.2 +++ b/src/stdlib/SDL_malloc.c Sat Feb 12 19:16:09 2011 -0800
236.3 @@ -1,6 +1,6 @@
236.4 /*
236.5 SDL - Simple DirectMedia Layer
236.6 - Copyright (C) 1997-2010 Sam Lantinga
236.7 + Copyright (C) 1997-2011 Sam Lantinga
236.8
236.9 This library is free software; you can redistribute it and/or
236.10 modify it under the terms of the GNU Lesser General Public
237.1 --- a/src/stdlib/SDL_stdlib.c Sun Feb 06 23:48:31 2011 -0800
237.2 +++ b/src/stdlib/SDL_stdlib.c Sat Feb 12 19:16:09 2011 -0800
237.3 @@ -1,6 +1,6 @@
237.4 /*
237.5 SDL - Simple DirectMedia Layer
237.6 - Copyright (C) 1997-2010 Sam Lantinga
237.7 + Copyright (C) 1997-2011 Sam Lantinga
237.8
237.9 This library is free software; you can redistribute it and/or
237.10 modify it under the terms of the GNU Lesser General Public
238.1 --- a/src/stdlib/SDL_string.c Sun Feb 06 23:48:31 2011 -0800
238.2 +++ b/src/stdlib/SDL_string.c Sat Feb 12 19:16:09 2011 -0800
238.3 @@ -1,6 +1,6 @@
238.4 /*
238.5 SDL - Simple DirectMedia Layer
238.6 - Copyright (C) 1997-2010 Sam Lantinga
238.7 + Copyright (C) 1997-2011 Sam Lantinga
238.8
238.9 This library is free software; you can redistribute it and/or
238.10 modify it under the terms of the GNU Lesser General Public
239.1 --- a/src/thread/SDL_systhread.h Sun Feb 06 23:48:31 2011 -0800
239.2 +++ b/src/thread/SDL_systhread.h Sat Feb 12 19:16:09 2011 -0800
239.3 @@ -1,6 +1,6 @@
239.4 /*
239.5 SDL - Simple DirectMedia Layer
239.6 - Copyright (C) 1997-2010 Sam Lantinga
239.7 + Copyright (C) 1997-2011 Sam Lantinga
239.8
239.9 This library is free software; you can redistribute it and/or
239.10 modify it under the terms of the GNU Lesser General Public
240.1 --- a/src/thread/SDL_thread.c Sun Feb 06 23:48:31 2011 -0800
240.2 +++ b/src/thread/SDL_thread.c Sat Feb 12 19:16:09 2011 -0800
240.3 @@ -1,6 +1,6 @@
240.4 /*
240.5 SDL - Simple DirectMedia Layer
240.6 - Copyright (C) 1997-2010 Sam Lantinga
240.7 + Copyright (C) 1997-2011 Sam Lantinga
240.8
240.9 This library is free software; you can redistribute it and/or
240.10 modify it under the terms of the GNU Lesser General Public
241.1 --- a/src/thread/SDL_thread_c.h Sun Feb 06 23:48:31 2011 -0800
241.2 +++ b/src/thread/SDL_thread_c.h Sat Feb 12 19:16:09 2011 -0800
241.3 @@ -1,6 +1,6 @@
241.4 /*
241.5 SDL - Simple DirectMedia Layer
241.6 - Copyright (C) 1997-2010 Sam Lantinga
241.7 + Copyright (C) 1997-2011 Sam Lantinga
241.8
241.9 This library is free software; you can redistribute it and/or
241.10 modify it under the terms of the GNU Lesser General Public
242.1 --- a/src/thread/beos/SDL_syssem.c Sun Feb 06 23:48:31 2011 -0800
242.2 +++ b/src/thread/beos/SDL_syssem.c Sat Feb 12 19:16:09 2011 -0800
242.3 @@ -1,6 +1,6 @@
242.4 /*
242.5 SDL - Simple DirectMedia Layer
242.6 - Copyright (C) 1997-2010 Sam Lantinga
242.7 + Copyright (C) 1997-2011 Sam Lantinga
242.8
242.9 This library is free software; you can redistribute it and/or
242.10 modify it under the terms of the GNU Lesser General Public
243.1 --- a/src/thread/beos/SDL_systhread.c Sun Feb 06 23:48:31 2011 -0800
243.2 +++ b/src/thread/beos/SDL_systhread.c Sat Feb 12 19:16:09 2011 -0800
243.3 @@ -1,6 +1,6 @@
243.4 /*
243.5 SDL - Simple DirectMedia Layer
243.6 - Copyright (C) 1997-2010 Sam Lantinga
243.7 + Copyright (C) 1997-2011 Sam Lantinga
243.8
243.9 This library is free software; you can redistribute it and/or
243.10 modify it under the terms of the GNU Lesser General Public
244.1 --- a/src/thread/beos/SDL_systhread_c.h Sun Feb 06 23:48:31 2011 -0800
244.2 +++ b/src/thread/beos/SDL_systhread_c.h Sat Feb 12 19:16:09 2011 -0800
244.3 @@ -1,6 +1,6 @@
244.4 /*
244.5 SDL - Simple DirectMedia Layer
244.6 - Copyright (C) 1997-2010 Sam Lantinga
244.7 + Copyright (C) 1997-2011 Sam Lantinga
244.8
244.9 This library is free software; you can redistribute it and/or
244.10 modify it under the terms of the GNU Lesser General Public
245.1 --- a/src/thread/generic/SDL_syscond.c Sun Feb 06 23:48:31 2011 -0800
245.2 +++ b/src/thread/generic/SDL_syscond.c Sat Feb 12 19:16:09 2011 -0800
245.3 @@ -1,6 +1,6 @@
245.4 /*
245.5 SDL - Simple DirectMedia Layer
245.6 - Copyright (C) 1997-2010 Sam Lantinga
245.7 + Copyright (C) 1997-2011 Sam Lantinga
245.8
245.9 This library is free software; you can redistribute it and/or
245.10 modify it under the terms of the GNU Lesser General Public
246.1 --- a/src/thread/generic/SDL_sysmutex.c Sun Feb 06 23:48:31 2011 -0800
246.2 +++ b/src/thread/generic/SDL_sysmutex.c Sat Feb 12 19:16:09 2011 -0800
246.3 @@ -1,6 +1,6 @@
246.4 /*
246.5 SDL - Simple DirectMedia Layer
246.6 - Copyright (C) 1997-2010 Sam Lantinga
246.7 + Copyright (C) 1997-2011 Sam Lantinga
246.8
246.9 This library is free software; you can redistribute it and/or
246.10 modify it under the terms of the GNU Lesser General Public
247.1 --- a/src/thread/generic/SDL_sysmutex_c.h Sun Feb 06 23:48:31 2011 -0800
247.2 +++ b/src/thread/generic/SDL_sysmutex_c.h Sat Feb 12 19:16:09 2011 -0800
247.3 @@ -1,6 +1,6 @@
247.4 /*
247.5 SDL - Simple DirectMedia Layer
247.6 - Copyright (C) 1997-2010 Sam Lantinga
247.7 + Copyright (C) 1997-2011 Sam Lantinga
247.8
247.9 This library is free software; you can redistribute it and/or
247.10 modify it under the terms of the GNU Lesser General Public
248.1 --- a/src/thread/generic/SDL_syssem.c Sun Feb 06 23:48:31 2011 -0800
248.2 +++ b/src/thread/generic/SDL_syssem.c Sat Feb 12 19:16:09 2011 -0800
248.3 @@ -1,6 +1,6 @@
248.4 /*
248.5 SDL - Simple DirectMedia Layer
248.6 - Copyright (C) 1997-2010 Sam Lantinga
248.7 + Copyright (C) 1997-2011 Sam Lantinga
248.8
248.9 This library is free software; you can redistribute it and/or
248.10 modify it under the terms of the GNU Lesser General Public
249.1 --- a/src/thread/generic/SDL_systhread.c Sun Feb 06 23:48:31 2011 -0800
249.2 +++ b/src/thread/generic/SDL_systhread.c Sat Feb 12 19:16:09 2011 -0800
249.3 @@ -1,6 +1,6 @@
249.4 /*
249.5 SDL - Simple DirectMedia Layer
249.6 - Copyright (C) 1997-2010 Sam Lantinga
249.7 + Copyright (C) 1997-2011 Sam Lantinga
249.8
249.9 This library is free software; you can redistribute it and/or
249.10 modify it under the terms of the GNU Lesser General Public
250.1 --- a/src/thread/generic/SDL_systhread_c.h Sun Feb 06 23:48:31 2011 -0800
250.2 +++ b/src/thread/generic/SDL_systhread_c.h Sat Feb 12 19:16:09 2011 -0800
250.3 @@ -1,6 +1,6 @@
250.4 /*
250.5 SDL - Simple DirectMedia Layer
250.6 - Copyright (C) 1997-2010 Sam Lantinga
250.7 + Copyright (C) 1997-2011 Sam Lantinga
250.8
250.9 This library is free software; you can redistribute it and/or
250.10 modify it under the terms of the GNU Lesser General Public
251.1 --- a/src/thread/irix/SDL_syssem.c Sun Feb 06 23:48:31 2011 -0800
251.2 +++ b/src/thread/irix/SDL_syssem.c Sat Feb 12 19:16:09 2011 -0800
251.3 @@ -1,6 +1,6 @@
251.4 /*
251.5 SDL - Simple DirectMedia Layer
251.6 - Copyright (C) 1997-2010 Sam Lantinga
251.7 + Copyright (C) 1997-2011 Sam Lantinga
251.8
251.9 This library is free software; you can redistribute it and/or
251.10 modify it under the terms of the GNU Lesser General Public
252.1 --- a/src/thread/irix/SDL_systhread.c Sun Feb 06 23:48:31 2011 -0800
252.2 +++ b/src/thread/irix/SDL_systhread.c Sat Feb 12 19:16:09 2011 -0800
252.3 @@ -1,6 +1,6 @@
252.4 /*
252.5 SDL - Simple DirectMedia Layer
252.6 - Copyright (C) 1997-2010 Sam Lantinga
252.7 + Copyright (C) 1997-2011 Sam Lantinga
252.8
252.9 This library is free software; you can redistribute it and/or
252.10 modify it under the terms of the GNU Lesser General Public
253.1 --- a/src/thread/irix/SDL_systhread_c.h Sun Feb 06 23:48:31 2011 -0800
253.2 +++ b/src/thread/irix/SDL_systhread_c.h Sat Feb 12 19:16:09 2011 -0800
253.3 @@ -1,6 +1,6 @@
253.4 /*
253.5 SDL - Simple DirectMedia Layer
253.6 - Copyright (C) 1997-2010 Sam Lantinga
253.7 + Copyright (C) 1997-2011 Sam Lantinga
253.8
253.9 This library is free software; you can redistribute it and/or
253.10 modify it under the terms of the GNU Lesser General Public
254.1 --- a/src/thread/nds/SDL_syscond.c Sun Feb 06 23:48:31 2011 -0800
254.2 +++ b/src/thread/nds/SDL_syscond.c Sat Feb 12 19:16:09 2011 -0800
254.3 @@ -1,6 +1,6 @@
254.4 /*
254.5 SDL - Simple DirectMedia Layer
254.6 - Copyright (C) 1997-2010 Sam Lantinga
254.7 + Copyright (C) 1997-2011 Sam Lantinga
254.8
254.9 This library is free software; you can redistribute it and/or
254.10 modify it under the terms of the GNU Lesser General Public
255.1 --- a/src/thread/nds/SDL_syscond_c.h Sun Feb 06 23:48:31 2011 -0800
255.2 +++ b/src/thread/nds/SDL_syscond_c.h Sat Feb 12 19:16:09 2011 -0800
255.3 @@ -1,6 +1,6 @@
255.4 /*
255.5 SDL - Simple DirectMedia Layer
255.6 - Copyright (C) 1997-2010 Sam Lantinga
255.7 + Copyright (C) 1997-2011 Sam Lantinga
255.8
255.9 This library is free software; you can redistribute it and/or
255.10 modify it under the terms of the GNU Lesser General Public
256.1 --- a/src/thread/nds/SDL_sysmutex.c Sun Feb 06 23:48:31 2011 -0800
256.2 +++ b/src/thread/nds/SDL_sysmutex.c Sat Feb 12 19:16:09 2011 -0800
256.3 @@ -1,6 +1,6 @@
256.4 /*
256.5 SDL - Simple DirectMedia Layer
256.6 - Copyright (C) 1997-2010 Sam Lantinga
256.7 + Copyright (C) 1997-2011 Sam Lantinga
256.8
256.9 This library is free software; you can redistribute it and/or
256.10 modify it under the terms of the GNU Lesser General Public
257.1 --- a/src/thread/nds/SDL_sysmutex_c.h Sun Feb 06 23:48:31 2011 -0800
257.2 +++ b/src/thread/nds/SDL_sysmutex_c.h Sat Feb 12 19:16:09 2011 -0800
257.3 @@ -1,6 +1,6 @@
257.4 /*
257.5 SDL - Simple DirectMedia Layer
257.6 - Copyright (C) 1997-2010 Sam Lantinga
257.7 + Copyright (C) 1997-2011 Sam Lantinga
257.8
257.9 This library is free software; you can redistribute it and/or
257.10 modify it under the terms of the GNU Lesser General Public
258.1 --- a/src/thread/nds/SDL_syssem.c Sun Feb 06 23:48:31 2011 -0800
258.2 +++ b/src/thread/nds/SDL_syssem.c Sat Feb 12 19:16:09 2011 -0800
258.3 @@ -1,6 +1,6 @@
258.4 /*
258.5 SDL - Simple DirectMedia Layer
258.6 - Copyright (C) 1997-2010 Sam Lantinga
258.7 + Copyright (C) 1997-2011 Sam Lantinga
258.8
258.9 This library is free software; you can redistribute it and/or
258.10 modify it under the terms of the GNU Lesser General Public
259.1 --- a/src/thread/nds/SDL_syssem_c.h Sun Feb 06 23:48:31 2011 -0800
259.2 +++ b/src/thread/nds/SDL_syssem_c.h Sat Feb 12 19:16:09 2011 -0800
259.3 @@ -1,6 +1,6 @@
259.4 /*
259.5 SDL - Simple DirectMedia Layer
259.6 - Copyright (C) 1997-2010 Sam Lantinga
259.7 + Copyright (C) 1997-2011 Sam Lantinga
259.8
259.9 This library is free software; you can redistribute it and/or
259.10 modify it under the terms of the GNU Lesser General Public
260.1 --- a/src/thread/nds/SDL_systhread.c Sun Feb 06 23:48:31 2011 -0800
260.2 +++ b/src/thread/nds/SDL_systhread.c Sat Feb 12 19:16:09 2011 -0800
260.3 @@ -1,6 +1,6 @@
260.4 /*
260.5 SDL - Simple DirectMedia Layer
260.6 - Copyright (C) 1997-2010 Sam Lantinga
260.7 + Copyright (C) 1997-2011 Sam Lantinga
260.8
260.9 This library is free software; you can redistribute it and/or
260.10 modify it under the terms of the GNU Lesser General Public
261.1 --- a/src/thread/nds/SDL_systhread_c.h Sun Feb 06 23:48:31 2011 -0800
261.2 +++ b/src/thread/nds/SDL_systhread_c.h Sat Feb 12 19:16:09 2011 -0800
261.3 @@ -1,6 +1,6 @@
261.4 /*
261.5 SDL - Simple DirectMedia Layer
261.6 - Copyright (C) 1997-2010 Sam Lantinga
261.7 + Copyright (C) 1997-2011 Sam Lantinga
261.8
261.9 This library is free software; you can redistribute it and/or
261.10 modify it under the terms of the GNU Lesser General Public
262.1 --- a/src/thread/pthread/SDL_syscond.c Sun Feb 06 23:48:31 2011 -0800
262.2 +++ b/src/thread/pthread/SDL_syscond.c Sat Feb 12 19:16:09 2011 -0800
262.3 @@ -1,6 +1,6 @@
262.4 /*
262.5 SDL - Simple DirectMedia Layer
262.6 - Copyright (C) 1997-2010 Sam Lantinga
262.7 + Copyright (C) 1997-2011 Sam Lantinga
262.8
262.9 This library is free software; you can redistribute it and/or
262.10 modify it under the terms of the GNU Lesser General Public
263.1 --- a/src/thread/pthread/SDL_sysmutex.c Sun Feb 06 23:48:31 2011 -0800
263.2 +++ b/src/thread/pthread/SDL_sysmutex.c Sat Feb 12 19:16:09 2011 -0800
263.3 @@ -1,6 +1,6 @@
263.4 /*
263.5 SDL - Simple DirectMedia Layer
263.6 - Copyright (C) 1997-2010 Sam Lantinga
263.7 + Copyright (C) 1997-2011 Sam Lantinga
263.8
263.9 This library is free software; you can redistribute it and/or
263.10 modify it under the terms of the GNU Lesser General Public
264.1 --- a/src/thread/pthread/SDL_sysmutex_c.h Sun Feb 06 23:48:31 2011 -0800
264.2 +++ b/src/thread/pthread/SDL_sysmutex_c.h Sat Feb 12 19:16:09 2011 -0800
264.3 @@ -1,6 +1,6 @@
264.4 /*
264.5 SDL - Simple DirectMedia Layer
264.6 - Copyright (C) 1997-2010 Sam Lantinga
264.7 + Copyright (C) 1997-2011 Sam Lantinga
264.8
264.9 This library is free software; you can redistribute it and/or
264.10 modify it under the terms of the GNU Lesser General Public
265.1 --- a/src/thread/pthread/SDL_syssem.c Sun Feb 06 23:48:31 2011 -0800
265.2 +++ b/src/thread/pthread/SDL_syssem.c Sat Feb 12 19:16:09 2011 -0800
265.3 @@ -1,6 +1,6 @@
265.4 /*
265.5 SDL - Simple DirectMedia Layer
265.6 - Copyright (C) 1997-2010 Sam Lantinga
265.7 + Copyright (C) 1997-2011 Sam Lantinga
265.8
265.9 This library is free software; you can redistribute it and/or
265.10 modify it under the terms of the GNU Lesser General Public
266.1 --- a/src/thread/pthread/SDL_systhread.c Sun Feb 06 23:48:31 2011 -0800
266.2 +++ b/src/thread/pthread/SDL_systhread.c Sat Feb 12 19:16:09 2011 -0800
266.3 @@ -1,6 +1,6 @@
266.4 /*
266.5 SDL - Simple DirectMedia Layer
266.6 - Copyright (C) 1997-2010 Sam Lantinga
266.7 + Copyright (C) 1997-2011 Sam Lantinga
266.8
266.9 This library is free software; you can redistribute it and/or
266.10 modify it under the terms of the GNU Lesser General Public
267.1 --- a/src/thread/pthread/SDL_systhread_c.h Sun Feb 06 23:48:31 2011 -0800
267.2 +++ b/src/thread/pthread/SDL_systhread_c.h Sat Feb 12 19:16:09 2011 -0800
267.3 @@ -1,6 +1,6 @@
267.4 /*
267.5 SDL - Simple DirectMedia Layer
267.6 - Copyright (C) 1997-2010 Sam Lantinga
267.7 + Copyright (C) 1997-2011 Sam Lantinga
267.8
267.9 This library is free software; you can redistribute it and/or
267.10 modify it under the terms of the GNU Lesser General Public
268.1 --- a/src/thread/windows/SDL_sysmutex.c Sun Feb 06 23:48:31 2011 -0800
268.2 +++ b/src/thread/windows/SDL_sysmutex.c Sat Feb 12 19:16:09 2011 -0800
268.3 @@ -1,6 +1,6 @@
268.4 /*
268.5 SDL - Simple DirectMedia Layer
268.6 - Copyright (C) 1997-2010 Sam Lantinga
268.7 + Copyright (C) 1997-2011 Sam Lantinga
268.8
268.9 This library is free software; you can redistribute it and/or
268.10 modify it under the terms of the GNU Lesser General Public
269.1 --- a/src/thread/windows/SDL_syssem.c Sun Feb 06 23:48:31 2011 -0800
269.2 +++ b/src/thread/windows/SDL_syssem.c Sat Feb 12 19:16:09 2011 -0800
269.3 @@ -1,6 +1,6 @@
269.4 /*
269.5 SDL - Simple DirectMedia Layer
269.6 - Copyright (C) 1997-2010 Sam Lantinga
269.7 + Copyright (C) 1997-2011 Sam Lantinga
269.8
269.9 This library is free software; you can redistribute it and/or
269.10 modify it under the terms of the GNU Lesser General Public
270.1 --- a/src/thread/windows/SDL_systhread.c Sun Feb 06 23:48:31 2011 -0800
270.2 +++ b/src/thread/windows/SDL_systhread.c Sat Feb 12 19:16:09 2011 -0800
270.3 @@ -1,6 +1,6 @@
270.4 /*
270.5 SDL - Simple DirectMedia Layer
270.6 - Copyright (C) 1997-2010 Sam Lantinga
270.7 + Copyright (C) 1997-2011 Sam Lantinga
270.8
270.9 This library is free software; you can redistribute it and/or
270.10 modify it under the terms of the GNU Lesser General Public
271.1 --- a/src/thread/windows/SDL_systhread_c.h Sun Feb 06 23:48:31 2011 -0800
271.2 +++ b/src/thread/windows/SDL_systhread_c.h Sat Feb 12 19:16:09 2011 -0800
271.3 @@ -1,6 +1,6 @@
271.4 /*
271.5 SDL - Simple DirectMedia Layer
271.6 - Copyright (C) 1997-2010 Sam Lantinga
271.7 + Copyright (C) 1997-2011 Sam Lantinga
271.8
271.9 This library is free software; you can redistribute it and/or
271.10 modify it under the terms of the GNU Lesser General Public
272.1 --- a/src/timer/SDL_timer.c Sun Feb 06 23:48:31 2011 -0800
272.2 +++ b/src/timer/SDL_timer.c Sat Feb 12 19:16:09 2011 -0800
272.3 @@ -1,6 +1,6 @@
272.4 /*
272.5 SDL - Simple DirectMedia Layer
272.6 - Copyright (C) 1997-2010 Sam Lantinga
272.7 + Copyright (C) 1997-2011 Sam Lantinga
272.8
272.9 This library is free software; you can redistribute it and/or
272.10 modify it under the terms of the GNU Lesser General Public
273.1 --- a/src/timer/SDL_timer_c.h Sun Feb 06 23:48:31 2011 -0800
273.2 +++ b/src/timer/SDL_timer_c.h Sat Feb 12 19:16:09 2011 -0800
273.3 @@ -1,6 +1,6 @@
273.4 /*
273.5 SDL - Simple DirectMedia Layer
273.6 - Copyright (C) 1997-2010 Sam Lantinga
273.7 + Copyright (C) 1997-2011 Sam Lantinga
273.8
273.9 This library is free software; you can redistribute it and/or
273.10 modify it under the terms of the GNU Lesser General Public
274.1 --- a/src/timer/beos/SDL_systimer.c Sun Feb 06 23:48:31 2011 -0800
274.2 +++ b/src/timer/beos/SDL_systimer.c Sat Feb 12 19:16:09 2011 -0800
274.3 @@ -1,6 +1,6 @@
274.4 /*
274.5 SDL - Simple DirectMedia Layer
274.6 - Copyright (C) 1997-2010 Sam Lantinga
274.7 + Copyright (C) 1997-2011 Sam Lantinga
274.8
274.9 This library is free software; you can redistribute it and/or
274.10 modify it under the terms of the GNU Lesser General Public
275.1 --- a/src/timer/dummy/SDL_systimer.c Sun Feb 06 23:48:31 2011 -0800
275.2 +++ b/src/timer/dummy/SDL_systimer.c Sat Feb 12 19:16:09 2011 -0800
275.3 @@ -1,6 +1,6 @@
275.4 /*
275.5 SDL - Simple DirectMedia Layer
275.6 - Copyright (C) 1997-2010 Sam Lantinga
275.7 + Copyright (C) 1997-2011 Sam Lantinga
275.8
275.9 This library is free software; you can redistribute it and/or
275.10 modify it under the terms of the GNU Lesser General Public
276.1 --- a/src/timer/nds/SDL_systimer.c Sun Feb 06 23:48:31 2011 -0800
276.2 +++ b/src/timer/nds/SDL_systimer.c Sat Feb 12 19:16:09 2011 -0800
276.3 @@ -1,6 +1,6 @@
276.4 /*
276.5 SDL - Simple DirectMedia Layer
276.6 - Copyright (C) 1997-2010 Sam Lantinga
276.7 + Copyright (C) 1997-2011 Sam Lantinga
276.8
276.9 This library is free software; you can redistribute it and/or
276.10 modify it under the terms of the GNU Lesser General Public
276.11 @@ -28,7 +28,7 @@
276.12
276.13 #include "SDL_timer.h"
276.14
276.15 -
276.16 +/* Will wrap afetr 49 days. Shouldn't be an issue. */
276.17 static volatile Uint32 timer_ticks;
276.18
276.19 static void
276.20 @@ -42,10 +42,8 @@
276.21 {
276.22 timer_ticks = 0;
276.23
276.24 - TIMER_CR(3) = TIMER_DIV_1024 | TIMER_IRQ_REQ;
276.25 - TIMER_DATA(3) = TIMER_FREQ_1024(1000);
276.26 - irqSet(IRQ_TIMER3, NDS_TimerInterrupt);
276.27 - irqEnable(IRQ_TIMER3);
276.28 + /* Set timer 2 to fire every ms. */
276.29 + timerStart(2, ClockDivider_1024, TIMER_FREQ_1024(1000), NDS_TimerInterrupt);
276.30 }
276.31
276.32 Uint32
276.33 @@ -58,7 +56,7 @@
276.34 SDL_Delay(Uint32 ms)
276.35 {
276.36 Uint32 start = SDL_GetTicks();
276.37 - while (timer_alive) {
276.38 + while (1) {
276.39 if ((SDL_GetTicks() - start) >= ms)
276.40 break;
276.41 }
277.1 --- a/src/timer/unix/SDL_systimer.c Sun Feb 06 23:48:31 2011 -0800
277.2 +++ b/src/timer/unix/SDL_systimer.c Sat Feb 12 19:16:09 2011 -0800
277.3 @@ -1,6 +1,6 @@
277.4 /*
277.5 SDL - Simple DirectMedia Layer
277.6 - Copyright (C) 1997-2010 Sam Lantinga
277.7 + Copyright (C) 1997-2011 Sam Lantinga
277.8
277.9 This library is free software; you can redistribute it and/or
277.10 modify it under the terms of the GNU Lesser General Public
278.1 --- a/src/timer/wince/SDL_systimer.c Sun Feb 06 23:48:31 2011 -0800
278.2 +++ b/src/timer/wince/SDL_systimer.c Sat Feb 12 19:16:09 2011 -0800
278.3 @@ -1,6 +1,6 @@
278.4 /*
278.5 SDL - Simple DirectMedia Layer
278.6 - Copyright (C) 1997-2010 Sam Lantinga
278.7 + Copyright (C) 1997-2011 Sam Lantinga
278.8
278.9 This library is free software; you can redistribute it and/or
278.10 modify it under the terms of the GNU Lesser General Public
279.1 --- a/src/timer/windows/SDL_systimer.c Sun Feb 06 23:48:31 2011 -0800
279.2 +++ b/src/timer/windows/SDL_systimer.c Sat Feb 12 19:16:09 2011 -0800
279.3 @@ -1,6 +1,6 @@
279.4 /*
279.5 SDL - Simple DirectMedia Layer
279.6 - Copyright (C) 1997-2010 Sam Lantinga
279.7 + Copyright (C) 1997-2011 Sam Lantinga
279.8
279.9 This library is free software; you can redistribute it and/or
279.10 modify it under the terms of the GNU Lesser General Public
280.1 --- a/src/video/SDL_RLEaccel.c Sun Feb 06 23:48:31 2011 -0800
280.2 +++ b/src/video/SDL_RLEaccel.c Sat Feb 12 19:16:09 2011 -0800
280.3 @@ -1,6 +1,6 @@
280.4 /*
280.5 SDL - Simple DirectMedia Layer
280.6 - Copyright (C) 1997-2010 Sam Lantinga
280.7 + Copyright (C) 1997-2011 Sam Lantinga
280.8
280.9 This library is free software; you can redistribute it and/or
280.10 modify it under the terms of the GNU Lesser General Public
281.1 --- a/src/video/SDL_RLEaccel_c.h Sun Feb 06 23:48:31 2011 -0800
281.2 +++ b/src/video/SDL_RLEaccel_c.h Sat Feb 12 19:16:09 2011 -0800
281.3 @@ -1,6 +1,6 @@
281.4 /*
281.5 SDL - Simple DirectMedia Layer
281.6 - Copyright (C) 1997-2010 Sam Lantinga
281.7 + Copyright (C) 1997-2011 Sam Lantinga
281.8
281.9 This library is free software; you can redistribute it and/or
281.10 modify it under the terms of the GNU Lesser General Public
282.1 --- a/src/video/SDL_blit.c Sun Feb 06 23:48:31 2011 -0800
282.2 +++ b/src/video/SDL_blit.c Sat Feb 12 19:16:09 2011 -0800
282.3 @@ -1,6 +1,6 @@
282.4 /*
282.5 SDL - Simple DirectMedia Layer
282.6 - Copyright (C) 1997-2010 Sam Lantinga
282.7 + Copyright (C) 1997-2011 Sam Lantinga
282.8
282.9 This library is free software; you can redistribute it and/or
282.10 modify it under the terms of the GNU Lesser General Public
282.11 @@ -100,30 +100,6 @@
282.12 return (okay ? 0 : -1);
282.13 }
282.14
282.15 -#ifdef __MACOSX__
282.16 -#include <sys/sysctl.h>
282.17 -
282.18 -static SDL_bool
282.19 -SDL_UseAltivecPrefetch()
282.20 -{
282.21 - const char key[] = "hw.l3cachesize";
282.22 - u_int64_t result = 0;
282.23 - size_t typeSize = sizeof(result);
282.24 -
282.25 - if (sysctlbyname(key, &result, &typeSize, NULL, 0) == 0 && result > 0) {
282.26 - return SDL_TRUE;
282.27 - } else {
282.28 - return SDL_FALSE;
282.29 - }
282.30 -}
282.31 -#else
282.32 -static SDL_bool
282.33 -SDL_UseAltivecPrefetch()
282.34 -{
282.35 - /* Just guess G4 */
282.36 - return SDL_TRUE;
282.37 -}
282.38 -#endif /* __MACOSX__ */
282.39
282.40 static SDL_BlitFunc
282.41 SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int flags,
282.42 @@ -145,22 +121,12 @@
282.43 if (SDL_HasMMX()) {
282.44 features |= SDL_CPU_MMX;
282.45 }
282.46 - if (SDL_Has3DNow()) {
282.47 - features |= SDL_CPU_3DNOW;
282.48 - }
282.49 if (SDL_HasSSE()) {
282.50 features |= SDL_CPU_SSE;
282.51 }
282.52 if (SDL_HasSSE2()) {
282.53 features |= SDL_CPU_SSE2;
282.54 }
282.55 - if (SDL_HasAltiVec()) {
282.56 - if (SDL_UseAltivecPrefetch()) {
282.57 - features |= SDL_CPU_ALTIVEC_PREFETCH;
282.58 - } else {
282.59 - features |= SDL_CPU_ALTIVEC_NOPREFETCH;
282.60 - }
282.61 - }
282.62 }
282.63 }
282.64
283.1 --- a/src/video/SDL_blit.h Sun Feb 06 23:48:31 2011 -0800
283.2 +++ b/src/video/SDL_blit.h Sat Feb 12 19:16:09 2011 -0800
283.3 @@ -1,6 +1,6 @@
283.4 /*
283.5 SDL - Simple DirectMedia Layer
283.6 - Copyright (C) 1997-2010 Sam Lantinga
283.7 + Copyright (C) 1997-2011 Sam Lantinga
283.8
283.9 This library is free software; you can redistribute it and/or
283.10 modify it under the terms of the GNU Lesser General Public
283.11 @@ -34,9 +34,6 @@
283.12 #ifdef __MMX__
283.13 #include <mmintrin.h>
283.14 #endif
283.15 -#ifdef __3dNOW__
283.16 -#include <mm3dnow.h>
283.17 -#endif
283.18 #ifdef __SSE__
283.19 #include <xmmintrin.h>
283.20 #endif
283.21 @@ -65,11 +62,8 @@
283.22 /* SDL blit CPU flags */
283.23 #define SDL_CPU_ANY 0x00000000
283.24 #define SDL_CPU_MMX 0x00000001
283.25 -#define SDL_CPU_3DNOW 0x00000002
283.26 #define SDL_CPU_SSE 0x00000004
283.27 #define SDL_CPU_SSE2 0x00000008
283.28 -#define SDL_CPU_ALTIVEC_PREFETCH 0x00000010
283.29 -#define SDL_CPU_ALTIVEC_NOPREFETCH 0x00000020
283.30
283.31 typedef struct
283.32 {
284.1 --- a/src/video/SDL_blit_0.c Sun Feb 06 23:48:31 2011 -0800
284.2 +++ b/src/video/SDL_blit_0.c Sat Feb 12 19:16:09 2011 -0800
284.3 @@ -1,6 +1,6 @@
284.4 /*
284.5 SDL - Simple DirectMedia Layer
284.6 - Copyright (C) 1997-2010 Sam Lantinga
284.7 + Copyright (C) 1997-2011 Sam Lantinga
284.8
284.9 This library is free software; you can redistribute it and/or
284.10 modify it under the terms of the GNU Lesser General Public
285.1 --- a/src/video/SDL_blit_1.c Sun Feb 06 23:48:31 2011 -0800
285.2 +++ b/src/video/SDL_blit_1.c Sat Feb 12 19:16:09 2011 -0800
285.3 @@ -1,6 +1,6 @@
285.4 /*
285.5 SDL - Simple DirectMedia Layer
285.6 - Copyright (C) 1997-2010 Sam Lantinga
285.7 + Copyright (C) 1997-2011 Sam Lantinga
285.8
285.9 This library is free software; you can redistribute it and/or
285.10 modify it under the terms of the GNU Lesser General Public
286.1 --- a/src/video/SDL_blit_A.c Sun Feb 06 23:48:31 2011 -0800
286.2 +++ b/src/video/SDL_blit_A.c Sat Feb 12 19:16:09 2011 -0800
286.3 @@ -1,6 +1,6 @@
286.4 /*
286.5 SDL - Simple DirectMedia Layer
286.6 - Copyright (C) 1997-2010 Sam Lantinga
286.7 + Copyright (C) 1997-2011 Sam Lantinga
286.8
286.9 This library is free software; you can redistribute it and/or
286.10 modify it under the terms of the GNU Lesser General Public
286.11 @@ -419,806 +419,6 @@
286.12
286.13 #endif /* __MMX__ */
286.14
286.15 -#if SDL_ALTIVEC_BLITTERS
286.16 -#if __MWERKS__
286.17 -#pragma altivec_model on
286.18 -#endif
286.19 -#if HAVE_ALTIVEC_H
286.20 -#include <altivec.h>
286.21 -#endif
286.22 -#include <assert.h>
286.23 -
286.24 -#if (defined(__MACOSX__) && (__GNUC__ < 4))
286.25 -#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
286.26 - (vector unsigned char) ( a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p )
286.27 -#define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
286.28 - (vector unsigned short) ( a,b,c,d,e,f,g,h )
286.29 -#else
286.30 -#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
286.31 - (vector unsigned char) { a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p }
286.32 -#define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
286.33 - (vector unsigned short) { a,b,c,d,e,f,g,h }
286.34 -#endif
286.35 -
286.36 -#define UNALIGNED_PTR(x) (((size_t) x) & 0x0000000F)
286.37 -#define VECPRINT(msg, v) do { \
286.38 - vector unsigned int tmpvec = (vector unsigned int)(v); \
286.39 - unsigned int *vp = (unsigned int *)&tmpvec; \
286.40 - printf("%s = %08X %08X %08X %08X\n", msg, vp[0], vp[1], vp[2], vp[3]); \
286.41 -} while (0)
286.42 -
286.43 -/* the permuation vector that takes the high bytes out of all the appropriate shorts
286.44 - (vector unsigned char)(
286.45 - 0x00, 0x10, 0x02, 0x12,
286.46 - 0x04, 0x14, 0x06, 0x16,
286.47 - 0x08, 0x18, 0x0A, 0x1A,
286.48 - 0x0C, 0x1C, 0x0E, 0x1E );
286.49 -*/
286.50 -#define VEC_MERGE_PERMUTE() (vec_add(vec_lvsl(0, (int*)NULL), (vector unsigned char)vec_splat_u16(0x0F)))
286.51 -#define VEC_U32_24() (vec_add(vec_splat_u32(12), vec_splat_u32(12)))
286.52 -#define VEC_ALPHA_MASK() ((vector unsigned char)vec_sl((vector unsigned int)vec_splat_s8(-1), VEC_U32_24()))
286.53 -#define VEC_ALIGNER(src) ((UNALIGNED_PTR(src)) \
286.54 - ? vec_lvsl(0, src) \
286.55 - : vec_add(vec_lvsl(8, src), vec_splat_u8(8)))
286.56 -
286.57 -
286.58 -#define VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1_16, v8_16) do { \
286.59 - /* vtemp1 contains source AAGGAAGGAAGGAAGG */ \
286.60 - vector unsigned short vtemp1 = vec_mule(vs, valpha); \
286.61 - /* vtemp2 contains source RRBBRRBBRRBBRRBB */ \
286.62 - vector unsigned short vtemp2 = vec_mulo(vs, valpha); \
286.63 - /* valpha2 is 255-alpha */ \
286.64 - vector unsigned char valpha2 = vec_nor(valpha, valpha); \
286.65 - /* vtemp3 contains dest AAGGAAGGAAGGAAGG */ \
286.66 - vector unsigned short vtemp3 = vec_mule(vd, valpha2); \
286.67 - /* vtemp4 contains dest RRBBRRBBRRBBRRBB */ \
286.68 - vector unsigned short vtemp4 = vec_mulo(vd, valpha2); \
286.69 - /* add source and dest */ \
286.70 - vtemp1 = vec_add(vtemp1, vtemp3); \
286.71 - vtemp2 = vec_add(vtemp2, vtemp4); \
286.72 - /* vtemp1 = (vtemp1 + 1) + ((vtemp1 + 1) >> 8) */ \
286.73 - vtemp1 = vec_add(vtemp1, v1_16); \
286.74 - vtemp3 = vec_sr(vtemp1, v8_16); \
286.75 - vtemp1 = vec_add(vtemp1, vtemp3); \
286.76 - /* vtemp2 = (vtemp2 + 1) + ((vtemp2 + 1) >> 8) */ \
286.77 - vtemp2 = vec_add(vtemp2, v1_16); \
286.78 - vtemp4 = vec_sr(vtemp2, v8_16); \
286.79 - vtemp2 = vec_add(vtemp2, vtemp4); \
286.80 - /* (>>8) and get ARGBARGBARGBARGB */ \
286.81 - vd = (vector unsigned char)vec_perm(vtemp1, vtemp2, mergePermute); \
286.82 -} while (0)
286.83 -
286.84 -/* Calculate the permute vector used for 32->32 swizzling */
286.85 -static vector unsigned char
286.86 -calc_swizzle32(const SDL_PixelFormat * srcfmt, const SDL_PixelFormat * dstfmt)
286.87 -{
286.88 - /*
286.89 - * We have to assume that the bits that aren't used by other
286.90 - * colors is alpha, and it's one complete byte, since some formats
286.91 - * leave alpha with a zero mask, but we should still swizzle the bits.
286.92 - */
286.93 - /* ARGB */
286.94 - const static struct SDL_PixelFormat default_pixel_format = {
286.95 - NULL, 0, 0,
286.96 - 0, 0, 0, 0,
286.97 - 16, 8, 0, 24,
286.98 - 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000
286.99 - };
286.100 - if (!srcfmt) {
286.101 - srcfmt = &default_pixel_format;
286.102 - }
286.103 - if (!dstfmt) {
286.104 - dstfmt = &default_pixel_format;
286.105 - }
286.106 - const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00,
286.107 - 0x04, 0x04, 0x04, 0x04,
286.108 - 0x08, 0x08, 0x08, 0x08,
286.109 - 0x0C, 0x0C, 0x0C,
286.110 - 0x0C);
286.111 - vector unsigned char vswiz;
286.112 - vector unsigned int srcvec;
286.113 -#define RESHIFT(X) (3 - ((X) >> 3))
286.114 - Uint32 rmask = RESHIFT(srcfmt->Rshift) << (dstfmt->Rshift);
286.115 - Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
286.116 - Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
286.117 - Uint32 amask;
286.118 - /* Use zero for alpha if either surface doesn't have alpha */
286.119 - if (dstfmt->Amask) {
286.120 - amask =
286.121 - ((srcfmt->Amask) ? RESHIFT(srcfmt->
286.122 - Ashift) : 0x10) << (dstfmt->Ashift);
286.123 - } else {
286.124 - amask =
286.125 - 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^
286.126 - 0xFFFFFFFF);
286.127 - }
286.128 -#undef RESHIFT
286.129 - ((unsigned int *) (char *) &srcvec)[0] = (rmask | gmask | bmask | amask);
286.130 - vswiz = vec_add(plus, (vector unsigned char) vec_splat(srcvec, 0));
286.131 - return (vswiz);
286.132 -}
286.133 -
286.134 -static void
286.135 -Blit32to565PixelAlphaAltivec(SDL_BlitInfo * info)
286.136 -{
286.137 - int height = info->dst_h;
286.138 - Uint8 *src = (Uint8 *) info->src;
286.139 - int srcskip = info->src_skip;
286.140 - Uint8 *dst = (Uint8 *) info->dst;
286.141 - int dstskip = info->dst_skip;
286.142 - SDL_PixelFormat *srcfmt = info->src_fmt;
286.143 -
286.144 - vector unsigned char v0 = vec_splat_u8(0);
286.145 - vector unsigned short v8_16 = vec_splat_u16(8);
286.146 - vector unsigned short v1_16 = vec_splat_u16(1);
286.147 - vector unsigned short v2_16 = vec_splat_u16(2);
286.148 - vector unsigned short v3_16 = vec_splat_u16(3);
286.149 - vector unsigned int v8_32 = vec_splat_u32(8);
286.150 - vector unsigned int v16_32 = vec_add(v8_32, v8_32);
286.151 - vector unsigned short v3f =
286.152 - VECUINT16_LITERAL(0x003f, 0x003f, 0x003f, 0x003f,
286.153 - 0x003f, 0x003f, 0x003f, 0x003f);
286.154 - vector unsigned short vfc =
286.155 - VECUINT16_LITERAL(0x00fc, 0x00fc, 0x00fc, 0x00fc,
286.156 - 0x00fc, 0x00fc, 0x00fc, 0x00fc);
286.157 -
286.158 - /*
286.159 - 0x10 - 0x1f is the alpha
286.160 - 0x00 - 0x0e evens are the red
286.161 - 0x01 - 0x0f odds are zero
286.162 - */
286.163 - vector unsigned char vredalpha1 = VECUINT8_LITERAL(0x10, 0x00, 0x01, 0x01,
286.164 - 0x10, 0x02, 0x01, 0x01,
286.165 - 0x10, 0x04, 0x01, 0x01,
286.166 - 0x10, 0x06, 0x01,
286.167 - 0x01);
286.168 - vector unsigned char vredalpha2 =
286.169 - (vector unsigned char) (vec_add((vector unsigned int) vredalpha1,
286.170 - vec_sl(v8_32, v16_32))
286.171 - );
286.172 - /*
286.173 - 0x00 - 0x0f is ARxx ARxx ARxx ARxx
286.174 - 0x11 - 0x0f odds are blue
286.175 - */
286.176 - vector unsigned char vblue1 = VECUINT8_LITERAL(0x00, 0x01, 0x02, 0x11,
286.177 - 0x04, 0x05, 0x06, 0x13,
286.178 - 0x08, 0x09, 0x0a, 0x15,
286.179 - 0x0c, 0x0d, 0x0e, 0x17);
286.180 - vector unsigned char vblue2 =
286.181 - (vector unsigned char) (vec_add((vector unsigned int) vblue1, v8_32)
286.182 - );
286.183 - /*
286.184 - 0x00 - 0x0f is ARxB ARxB ARxB ARxB
286.185 - 0x10 - 0x0e evens are green
286.186 - */
286.187 - vector unsigned char vgreen1 = VECUINT8_LITERAL(0x00, 0x01, 0x10, 0x03,
286.188 - 0x04, 0x05, 0x12, 0x07,
286.189 - 0x08, 0x09, 0x14, 0x0b,
286.190 - 0x0c, 0x0d, 0x16, 0x0f);
286.191 - vector unsigned char vgreen2 =
286.192 - (vector unsigned
286.193 - char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8_32, v8_32))
286.194 - );
286.195 - vector unsigned char vgmerge = VECUINT8_LITERAL(0x00, 0x02, 0x00, 0x06,
286.196 - 0x00, 0x0a, 0x00, 0x0e,
286.197 - 0x00, 0x12, 0x00, 0x16,
286.198 - 0x00, 0x1a, 0x00, 0x1e);
286.199 - vector unsigned char mergePermute = VEC_MERGE_PERMUTE();
286.200 - vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL);
286.201 - vector unsigned char valphaPermute =
286.202 - vec_and(vec_lvsl(0, (int *) NULL), vec_splat_u8(0xC));
286.203 -
286.204 - vector unsigned short vf800 = (vector unsigned short) vec_splat_u8(-7);
286.205 - vf800 = vec_sl(vf800, vec_splat_u16(8));
286.206 -
286.207 - while (height--) {
286.208 - int extrawidth;
286.209 - vector unsigned char valigner;
286.210 - vector unsigned char vsrc;
286.211 - vector unsigned char voverflow;
286.212 - int width = info->dst_w;
286.213 -
286.214 -#define ONE_PIXEL_BLEND(condition, widthvar) \
286.215 - while (condition) { \
286.216 - Uint32 Pixel; \
286.217 - unsigned sR, sG, sB, dR, dG, dB, sA; \
286.218 - DISEMBLE_RGBA(src, 4, srcfmt, Pixel, sR, sG, sB, sA); \
286.219 - if(sA) { \
286.220 - unsigned short dstpixel = *((unsigned short *)dst); \
286.221 - dR = (dstpixel >> 8) & 0xf8; \
286.222 - dG = (dstpixel >> 3) & 0xfc; \
286.223 - dB = (dstpixel << 3) & 0xf8; \
286.224 - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \
286.225 - *((unsigned short *)dst) = ( \
286.226 - ((dR & 0xf8) << 8) | ((dG & 0xfc) << 3) | (dB >> 3) \
286.227 - ); \
286.228 - } \
286.229 - src += 4; \
286.230 - dst += 2; \
286.231 - widthvar--; \
286.232 - }
286.233 - ONE_PIXEL_BLEND((UNALIGNED_PTR(dst)) && (width), width);
286.234 - extrawidth = (width % 8);
286.235 - valigner = VEC_ALIGNER(src);
286.236 - vsrc = (vector unsigned char) vec_ld(0, src);
286.237 - width -= extrawidth;
286.238 - while (width) {
286.239 - vector unsigned char valpha;
286.240 - vector unsigned char vsrc1, vsrc2;
286.241 - vector unsigned char vdst1, vdst2;
286.242 - vector unsigned short vR, vG, vB;
286.243 - vector unsigned short vpixel, vrpixel, vgpixel, vbpixel;
286.244 -
286.245 - /* Load 8 pixels from src as ARGB */
286.246 - voverflow = (vector unsigned char) vec_ld(15, src);
286.247 - vsrc = vec_perm(vsrc, voverflow, valigner);
286.248 - vsrc1 = vec_perm(vsrc, vsrc, vpermute);
286.249 - src += 16;
286.250 - vsrc = (vector unsigned char) vec_ld(15, src);
286.251 - voverflow = vec_perm(voverflow, vsrc, valigner);
286.252 - vsrc2 = vec_perm(voverflow, voverflow, vpermute);
286.253 - src += 16;
286.254 -
286.255 - /* Load 8 pixels from dst as XRGB */
286.256 - voverflow = vec_ld(0, dst);
286.257 - vR = vec_and((vector unsigned short) voverflow, vf800);
286.258 - vB = vec_sl((vector unsigned short) voverflow, v3_16);
286.259 - vG = vec_sl(vB, v2_16);
286.260 - vdst1 =
286.261 - (vector unsigned char) vec_perm((vector unsigned char) vR,
286.262 - (vector unsigned char) vR,
286.263 - vredalpha1);
286.264 - vdst1 = vec_perm(vdst1, (vector unsigned char) vB, vblue1);
286.265 - vdst1 = vec_perm(vdst1, (vector unsigned char) vG, vgreen1);
286.266 - vdst2 =
286.267 - (vector unsigned char) vec_perm((vector unsigned char) vR,
286.268 - (vector unsigned char) vR,
286.269 - vredalpha2);
286.270 - vdst2 = vec_perm(vdst2, (vector unsigned char) vB, vblue2);
286.271 - vdst2 = vec_perm(vdst2, (vector unsigned char) vG, vgreen2);
286.272 -
286.273 - /* Alpha blend 8 pixels as ARGB */
286.274 - valpha = vec_perm(vsrc1, v0, valphaPermute);
286.275 - VEC_MULTIPLY_ALPHA(vsrc1, vdst1, valpha, mergePermute, v1_16,
286.276 - v8_16);
286.277 - valpha = vec_perm(vsrc2, v0, valphaPermute);
286.278 - VEC_MULTIPLY_ALPHA(vsrc2, vdst2, valpha, mergePermute, v1_16,
286.279 - v8_16);
286.280 -
286.281 - /* Convert 8 pixels to 565 */
286.282 - vpixel = (vector unsigned short) vec_packpx((vector unsigned int)
286.283 - vdst1,
286.284 - (vector unsigned int)
286.285 - vdst2);
286.286 - vgpixel = (vector unsigned short) vec_perm(vdst1, vdst2, vgmerge);
286.287 - vgpixel = vec_and(vgpixel, vfc);
286.288 - vgpixel = vec_sl(vgpixel, v3_16);
286.289 - vrpixel = vec_sl(vpixel, v1_16);
286.290 - vrpixel = vec_and(vrpixel, vf800);
286.291 - vbpixel = vec_and(vpixel, v3f);
286.292 - vdst1 =
286.293 - vec_or((vector unsigned char) vrpixel,
286.294 - (vector unsigned char) vgpixel);
286.295 - vdst1 = vec_or(vdst1, (vector unsigned char) vbpixel);
286.296 -
286.297 - /* Store 8 pixels */
286.298 - vec_st(vdst1, 0, dst);
286.299 -
286.300 - width -= 8;
286.301 - dst += 16;
286.302 - }
286.303 - ONE_PIXEL_BLEND((extrawidth), extrawidth);
286.304 -#undef ONE_PIXEL_BLEND
286.305 - src += srcskip;
286.306 - dst += dstskip;
286.307 - }
286.308 -}
286.309 -
286.310 -static void
286.311 -Blit32to32SurfaceAlphaKeyAltivec(SDL_BlitInfo * info)
286.312 -{
286.313 - int height = info->dst_h;
286.314 - Uint32 *srcp = (Uint32 *) info->src;
286.315 - int srcskip = info->src_skip >> 2;
286.316 - Uint32 *dstp = (Uint32 *) info->dst;
286.317 - int dstskip = info->dst_skip >> 2;
286.318 - SDL_PixelFormat *srcfmt = info->src_fmt;
286.319 - SDL_PixelFormat *dstfmt = info->dst_fmt;
286.320 - unsigned sA = info->a;
286.321 - unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0;
286.322 - Uint32 rgbmask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
286.323 - Uint32 ckey = info->colorkey;
286.324 - vector unsigned char mergePermute;
286.325 - vector unsigned char vsrcPermute;
286.326 - vector unsigned char vdstPermute;
286.327 - vector unsigned char vsdstPermute;
286.328 - vector unsigned char valpha;
286.329 - vector unsigned char valphamask;
286.330 - vector unsigned char vbits;
286.331 - vector unsigned char v0;
286.332 - vector unsigned short v1;
286.333 - vector unsigned short v8;
286.334 - vector unsigned int vckey;
286.335 - vector unsigned int vrgbmask;
286.336 -
286.337 - mergePermute = VEC_MERGE_PERMUTE();
286.338 - v0 = vec_splat_u8(0);
286.339 - v1 = vec_splat_u16(1);
286.340 - v8 = vec_splat_u16(8);
286.341 -
286.342 - /* set the alpha to 255 on the destination surf */
286.343 - valphamask = VEC_ALPHA_MASK();
286.344 -
286.345 - vsrcPermute = calc_swizzle32(srcfmt, NULL);
286.346 - vdstPermute = calc_swizzle32(NULL, dstfmt);
286.347 - vsdstPermute = calc_swizzle32(dstfmt, NULL);
286.348 -
286.349 - /* set a vector full of alpha and 255-alpha */
286.350 - ((unsigned char *) &valpha)[0] = sA;
286.351 - valpha = vec_splat(valpha, 0);
286.352 - vbits = (vector unsigned char) vec_splat_s8(-1);
286.353 -
286.354 - ckey &= rgbmask;
286.355 - ((unsigned int *) (char *) &vckey)[0] = ckey;
286.356 - vckey = vec_splat(vckey, 0);
286.357 - ((unsigned int *) (char *) &vrgbmask)[0] = rgbmask;
286.358 - vrgbmask = vec_splat(vrgbmask, 0);
286.359 -
286.360 - while (height--) {
286.361 - int width = info->dst_w;
286.362 -#define ONE_PIXEL_BLEND(condition, widthvar) \
286.363 - while (condition) { \
286.364 - Uint32 Pixel; \
286.365 - unsigned sR, sG, sB, dR, dG, dB; \
286.366 - RETRIEVE_RGB_PIXEL(((Uint8 *)srcp), 4, Pixel); \
286.367 - if(sA && Pixel != ckey) { \
286.368 - RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); \
286.369 - DISEMBLE_RGB(((Uint8 *)dstp), 4, dstfmt, Pixel, dR, dG, dB); \
286.370 - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \
286.371 - ASSEMBLE_RGBA(((Uint8 *)dstp), 4, dstfmt, dR, dG, dB, dA); \
286.372 - } \
286.373 - dstp++; \
286.374 - srcp++; \
286.375 - widthvar--; \
286.376 - }
286.377 - ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
286.378 - if (width > 0) {
286.379 - int extrawidth = (width % 4);
286.380 - vector unsigned char valigner = VEC_ALIGNER(srcp);
286.381 - vector unsigned char vs = (vector unsigned char) vec_ld(0, srcp);
286.382 - width -= extrawidth;
286.383 - while (width) {
286.384 - vector unsigned char vsel;
286.385 - vector unsigned char voverflow;
286.386 - vector unsigned char vd;
286.387 - vector unsigned char vd_orig;
286.388 -
286.389 - /* s = *srcp */
286.390 - voverflow = (vector unsigned char) vec_ld(15, srcp);
286.391 - vs = vec_perm(vs, voverflow, valigner);
286.392 -
286.393 - /* vsel is set for items that match the key */
286.394 - vsel =
286.395 - (vector unsigned char) vec_and((vector unsigned int) vs,
286.396 - vrgbmask);
286.397 - vsel = (vector unsigned char) vec_cmpeq((vector unsigned int)
286.398 - vsel, vckey);
286.399 -
286.400 - /* permute to source format */
286.401 - vs = vec_perm(vs, valpha, vsrcPermute);
286.402 -
286.403 - /* d = *dstp */
286.404 - vd = (vector unsigned char) vec_ld(0, dstp);
286.405 - vd_orig = vd = vec_perm(vd, v0, vsdstPermute);
286.406 -
286.407 - VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
286.408 -
286.409 - /* set the alpha channel to full on */
286.410 - vd = vec_or(vd, valphamask);
286.411 -
286.412 - /* mask out color key */
286.413 - vd = vec_sel(vd, vd_orig, vsel);
286.414 -
286.415 - /* permute to dest format */
286.416 - vd = vec_perm(vd, vbits, vdstPermute);
286.417 -
286.418 - /* *dstp = res */
286.419 - vec_st((vector unsigned int) vd, 0, dstp);
286.420 -
286.421 - srcp += 4;
286.422 - dstp += 4;
286.423 - width -= 4;
286.424 - vs = voverflow;
286.425 - }
286.426 - ONE_PIXEL_BLEND((extrawidth), extrawidth);
286.427 - }
286.428 -#undef ONE_PIXEL_BLEND
286.429 -
286.430 - srcp += srcskip;
286.431 - dstp += dstskip;
286.432 - }
286.433 -}
286.434 -
286.435 -
286.436 -static void
286.437 -Blit32to32PixelAlphaAltivec(SDL_BlitInfo * info)
286.438 -{
286.439 - int width = info->dst_w;
286.440 - int height = info->dst_h;
286.441 - Uint32 *srcp = (Uint32 *) info->src;
286.442 - int srcskip = info->src_skip >> 2;
286.443 - Uint32 *dstp = (Uint32 *) info->dst;
286.444 - int dstskip = info->dst_skip >> 2;
286.445 - SDL_PixelFormat *srcfmt = info->src_fmt;
286.446 - SDL_PixelFormat *dstfmt = info->dst_fmt;
286.447 - vector unsigned char mergePermute;
286.448 - vector unsigned char valphaPermute;
286.449 - vector unsigned char vsrcPermute;
286.450 - vector unsigned char vdstPermute;
286.451 - vector unsigned char vsdstPermute;
286.452 - vector unsigned char valphamask;
286.453 - vector unsigned char vpixelmask;
286.454 - vector unsigned char v0;
286.455 - vector unsigned short v1;
286.456 - vector unsigned short v8;
286.457 -
286.458 - v0 = vec_splat_u8(0);
286.459 - v1 = vec_splat_u16(1);
286.460 - v8 = vec_splat_u16(8);
286.461 - mergePermute = VEC_MERGE_PERMUTE();
286.462 - valphamask = VEC_ALPHA_MASK();
286.463 - valphaPermute = vec_and(vec_lvsl(0, (int *) NULL), vec_splat_u8(0xC));
286.464 - vpixelmask = vec_nor(valphamask, v0);
286.465 - vsrcPermute = calc_swizzle32(srcfmt, NULL);
286.466 - vdstPermute = calc_swizzle32(NULL, dstfmt);
286.467 - vsdstPermute = calc_swizzle32(dstfmt, NULL);
286.468 -
286.469 - while (height--) {
286.470 - width = info->dst_w;
286.471 -#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \
286.472 - Uint32 Pixel; \
286.473 - unsigned sR, sG, sB, dR, dG, dB, sA, dA; \
286.474 - DISEMBLE_RGBA((Uint8 *)srcp, 4, srcfmt, Pixel, sR, sG, sB, sA); \
286.475 - if(sA) { \
286.476 - DISEMBLE_RGBA((Uint8 *)dstp, 4, dstfmt, Pixel, dR, dG, dB, dA); \
286.477 - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \
286.478 - ASSEMBLE_RGBA((Uint8 *)dstp, 4, dstfmt, dR, dG, dB, dA); \
286.479 - } \
286.480 - ++srcp; \
286.481 - ++dstp; \
286.482 - widthvar--; \
286.483 - }
286.484 - ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
286.485 - if (width > 0) {
286.486 - /* vsrcPermute */
286.487 - /* vdstPermute */
286.488 - int extrawidth = (width % 4);
286.489 - vector unsigned char valigner = VEC_ALIGNER(srcp);
286.490 - vector unsigned char vs = (vector unsigned char) vec_ld(0, srcp);
286.491 - width -= extrawidth;
286.492 - while (width) {
286.493 - vector unsigned char voverflow;
286.494 - vector unsigned char vd;
286.495 - vector unsigned char valpha;
286.496 - vector unsigned char vdstalpha;
286.497 - /* s = *srcp */
286.498 - voverflow = (vector unsigned char) vec_ld(15, srcp);
286.499 - vs = vec_perm(vs, voverflow, valigner);
286.500 - vs = vec_perm(vs, v0, vsrcPermute);
286.501 -
286.502 - valpha = vec_perm(vs, v0, valphaPermute);
286.503 -
286.504 - /* d = *dstp */
286.505 - vd = (vector unsigned char) vec_ld(0, dstp);
286.506 - vd = vec_perm(vd, v0, vsdstPermute);
286.507 - vdstalpha = vec_and(vd, valphamask);
286.508 -
286.509 - VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
286.510 -
286.511 - /* set the alpha to the dest alpha */
286.512 - vd = vec_and(vd, vpixelmask);
286.513 - vd = vec_or(vd, vdstalpha);
286.514 - vd = vec_perm(vd, v0, vdstPermute);
286.515 -
286.516 - /* *dstp = res */
286.517 - vec_st((vector unsigned int) vd, 0, dstp);
286.518 -
286.519 - srcp += 4;
286.520 - dstp += 4;
286.521 - width -= 4;
286.522 - vs = voverflow;
286.523 -
286.524 - }
286.525 - ONE_PIXEL_BLEND((extrawidth), extrawidth);
286.526 - }
286.527 - srcp += srcskip;
286.528 - dstp += dstskip;
286.529 -#undef ONE_PIXEL_BLEND
286.530 - }
286.531 -}
286.532 -
286.533 -/* fast ARGB888->(A)RGB888 blending with pixel alpha */
286.534 -static void
286.535 -BlitRGBtoRGBPixelAlphaAltivec(SDL_BlitInfo * info)
286.536 -{
286.537 - int width = info->dst_w;
286.538 - int height = info->dst_h;
286.539 - Uint32 *srcp = (Uint32 *) info->src;
286.540 - int srcskip = info->src_skip >> 2;
286.541 - Uint32 *dstp = (Uint32 *) info->dst;
286.542 - int dstskip = info->dst_skip >> 2;
286.543 - vector unsigned char mergePermute;
286.544 - vector unsigned char valphaPermute;
286.545 - vector unsigned char valphamask;
286.546 - vector unsigned char vpixelmask;
286.547 - vector unsigned char v0;
286.548 - vector unsigned short v1;
286.549 - vector unsigned short v8;
286.550 - v0 = vec_splat_u8(0);
286.551 - v1 = vec_splat_u16(1);
286.552 - v8 = vec_splat_u16(8);
286.553 - mergePermute = VEC_MERGE_PERMUTE();
286.554 - valphamask = VEC_ALPHA_MASK();
286.555 - valphaPermute = vec_and(vec_lvsl(0, (int *) NULL), vec_splat_u8(0xC));
286.556 -
286.557 -
286.558 - vpixelmask = vec_nor(valphamask, v0);
286.559 - while (height--) {
286.560 - width = info->dst_w;
286.561 -#define ONE_PIXEL_BLEND(condition, widthvar) \
286.562 - while ((condition)) { \
286.563 - Uint32 dalpha; \
286.564 - Uint32 d; \
286.565 - Uint32 s1; \
286.566 - Uint32 d1; \
286.567 - Uint32 s = *srcp; \
286.568 - Uint32 alpha = s >> 24; \
286.569 - if(alpha) { \
286.570 - if(alpha == SDL_ALPHA_OPAQUE) { \
286.571 - *dstp = (s & 0x00ffffff) | (*dstp & 0xff000000); \
286.572 - } else { \
286.573 - d = *dstp; \
286.574 - dalpha = d & 0xff000000; \
286.575 - s1 = s & 0xff00ff; \
286.576 - d1 = d & 0xff00ff; \
286.577 - d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \
286.578 - s &= 0xff00; \
286.579 - d &= 0xff00; \
286.580 - d = (d + ((s - d) * alpha >> 8)) & 0xff00; \
286.581 - *dstp = d1 | d | dalpha; \
286.582 - } \
286.583 - } \
286.584 - ++srcp; \
286.585 - ++dstp; \
286.586 - widthvar--; \
286.587 - }
286.588 - ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
286.589 - if (width > 0) {
286.590 - int extrawidth = (width % 4);
286.591 - vector unsigned char valigner = VEC_ALIGNER(srcp);
286.592 - vector unsigned char vs = (vector unsigned char) vec_ld(0, srcp);
286.593 - width -= extrawidth;
286.594 - while (width) {
286.595 - vector unsigned char voverflow;
286.596 - vector unsigned char vd;
286.597 - vector unsigned char valpha;
286.598 - vector unsigned char vdstalpha;
286.599 - /* s = *srcp */
286.600 - voverflow = (vector unsigned char) vec_ld(15, srcp);
286.601 - vs = vec_perm(vs, voverflow, valigner);
286.602 -
286.603 - valpha = vec_perm(vs, v0, valphaPermute);
286.604 -
286.605 - /* d = *dstp */
286.606 - vd = (vector unsigned char) vec_ld(0, dstp);
286.607 - vdstalpha = vec_and(vd, valphamask);
286.608 -
286.609 - VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
286.610 -
286.611 - /* set the alpha to the dest alpha */
286.612 - vd = vec_and(vd, vpixelmask);
286.613 - vd = vec_or(vd, vdstalpha);
286.614 -
286.615 - /* *dstp = res */
286.616 - vec_st((vector unsigned int) vd, 0, dstp);
286.617 -
286.618 - srcp += 4;
286.619 - dstp += 4;
286.620 - width -= 4;
286.621 - vs = voverflow;
286.622 - }
286.623 - ONE_PIXEL_BLEND((extrawidth), extrawidth);
286.624 - }
286.625 - srcp += srcskip;
286.626 - dstp += dstskip;
286.627 - }
286.628 -#undef ONE_PIXEL_BLEND
286.629 -}
286.630 -
286.631 -static void
286.632 -Blit32to32SurfaceAlphaAltivec(SDL_BlitInfo * info)
286.633 -{
286.634 - /* XXX : 6 */
286.635 - int height = info->dst_h;
286.636 - Uint32 *srcp = (Uint32 *) info->src;
286.637 - int srcskip = info->src_skip >> 2;
286.638 - Uint32 *dstp = (Uint32 *) info->dst;
286.639 - int dstskip = info->dst_skip >> 2;
286.640 - SDL_PixelFormat *srcfmt = info->src_fmt;
286.641 - SDL_PixelFormat *dstfmt = info->dst_fmt;
286.642 - unsigned sA = info->a;
286.643 - unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0;
286.644 - vector unsigned char mergePermute;
286.645 - vector unsigned char vsrcPermute;
286.646 - vector unsigned char vdstPermute;
286.647 - vector unsigned char vsdstPermute;
286.648 - vector unsigned char valpha;
286.649 - vector unsigned char valphamask;
286.650 - vector unsigned char vbits;
286.651 - vector unsigned short v1;
286.652 - vector unsigned short v8;
286.653 -
286.654 - mergePermute = VEC_MERGE_PERMUTE();
286.655 - v1 = vec_splat_u16(1);
286.656 - v8 = vec_splat_u16(8);
286.657 -
286.658 - /* set the alpha to 255 on the destination surf */
286.659 - valphamask = VEC_ALPHA_MASK();
286.660 -
286.661 - vsrcPermute = calc_swizzle32(srcfmt, NULL);
286.662 - vdstPermute = calc_swizzle32(NULL, dstfmt);
286.663 - vsdstPermute = calc_swizzle32(dstfmt, NULL);
286.664 -
286.665 - /* set a vector full of alpha and 255-alpha */
286.666 - ((unsigned char *) &valpha)[0] = sA;
286.667 - valpha = vec_splat(valpha, 0);
286.668 - vbits = (vector unsigned char) vec_splat_s8(-1);
286.669 -
286.670 - while (height--) {
286.671 - int width = info->dst_w;
286.672 -#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \
286.673 - Uint32 Pixel; \
286.674 - unsigned sR, sG, sB, dR, dG, dB; \
286.675 - DISEMBLE_RGB(((Uint8 *)srcp), 4, srcfmt, Pixel, sR, sG, sB); \
286.676 - DISEMBLE_RGB(((Uint8 *)dstp), 4, dstfmt, Pixel, dR, dG, dB); \
286.677 - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \
286.678 - ASSEMBLE_RGBA(((Uint8 *)dstp), 4, dstfmt, dR, dG, dB, dA); \
286.679 - ++srcp; \
286.680 - ++dstp; \
286.681 - widthvar--; \
286.682 - }
286.683 - ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
286.684 - if (width > 0) {
286.685 - int extrawidth = (width % 4);
286.686 - vector unsigned char valigner = VEC_ALIGNER(srcp);
286.687 - vector unsigned char vs = (vector unsigned char) vec_ld(0, srcp);
286.688 - width -= extrawidth;
286.689 - while (width) {
286.690 - vector unsigned char voverflow;
286.691 - vector unsigned char vd;
286.692 -
286.693 - /* s = *srcp */
286.694 - voverflow = (vector unsigned char) vec_ld(15, srcp);
286.695 - vs = vec_perm(vs, voverflow, valigner);
286.696 - vs = vec_perm(vs, valpha, vsrcPermute);
286.697 -
286.698 - /* d = *dstp */
286.699 - vd = (vector unsigned char) vec_ld(0, dstp);
286.700 - vd = vec_perm(vd, vd, vsdstPermute);
286.701 -
286.702 - VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
286.703 -
286.704 - /* set the alpha channel to full on */
286.705 - vd = vec_or(vd, valphamask);
286.706 - vd = vec_perm(vd, vbits, vdstPermute);
286.707 -
286.708 - /* *dstp = res */
286.709 - vec_st((vector unsigned int) vd, 0, dstp);
286.710 -
286.711 - srcp += 4;
286.712 - dstp += 4;
286.713 - width -= 4;
286.714 - vs = voverflow;
286.715 - }
286.716 - ONE_PIXEL_BLEND((extrawidth), extrawidth);
286.717 - }
286.718 -#undef ONE_PIXEL_BLEND
286.719 -
286.720 - srcp += srcskip;
286.721 - dstp += dstskip;
286.722 - }
286.723 -
286.724 -}
286.725 -
286.726 -
286.727 -/* fast RGB888->(A)RGB888 blending */
286.728 -static void
286.729 -BlitRGBtoRGBSurfaceAlphaAltivec(SDL_BlitInfo * info)
286.730 -{
286.731 - unsigned alpha = info->a;
286.732 - int height = info->dst_h;
286.733 - Uint32 *srcp = (Uint32 *) info->src;
286.734 - int srcskip = info->src_skip >> 2;
286.735 - Uint32 *dstp = (Uint32 *) info->dst;
286.736 - int dstskip = info->dst_skip >> 2;
286.737 - vector unsigned char mergePermute;
286.738 - vector unsigned char valpha;
286.739 - vector unsigned char valphamask;
286.740 - vector unsigned short v1;
286.741 - vector unsigned short v8;
286.742 -
286.743 - mergePermute = VEC_MERGE_PERMUTE();
286.744 - v1 = vec_splat_u16(1);
286.745 - v8 = vec_splat_u16(8);
286.746 -
286.747 - /* set the alpha to 255 on the destination surf */
286.748 - valphamask = VEC_ALPHA_MASK();
286.749 -
286.750 - /* set a vector full of alpha and 255-alpha */
286.751 - ((unsigned char *) &valpha)[0] = alpha;
286.752 - valpha = vec_splat(valpha, 0);
286.753 -
286.754 - while (height--) {
286.755 - int width = info->dst_w;
286.756 -#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \
286.757 - Uint32 s = *srcp; \
286.758 - Uint32 d = *dstp; \
286.759 - Uint32 s1 = s & 0xff00ff; \
286.760 - Uint32 d1 = d & 0xff00ff; \
286.761 - d1 = (d1 + ((s1 - d1) * alpha >> 8)) \
286.762 - & 0xff00ff; \
286.763 - s &= 0xff00; \
286.764 - d &= 0xff00; \
286.765 - d = (d + ((s - d) * alpha >> 8)) & 0xff00; \
286.766 - *dstp = d1 | d | 0xff000000; \
286.767 - ++srcp; \
286.768 - ++dstp; \
286.769 - widthvar--; \
286.770 - }
286.771 - ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
286.772 - if (width > 0) {
286.773 - int extrawidth = (width % 4);
286.774 - vector unsigned char valigner = VEC_ALIGNER(srcp);
286.775 - vector unsigned char vs = (vector unsigned char) vec_ld(0, srcp);
286.776 - width -= extrawidth;
286.777 - while (width) {
286.778 - vector unsigned char voverflow;
286.779 - vector unsigned char vd;
286.780 -
286.781 - /* s = *srcp */